magento / composer-dependency-version-audit-plugin
通过 composer 插件验证包
0.1.5
2023-04-12 17:04 UTC
Requires
- composer-plugin-api: ^1.0 || ^2.0
- composer/composer: ^1.9 || ^2.0
Requires (Dev)
- phpunit/phpunit: ^9
README
此 composer 插件用于保护 Adobe Commerce 商家免受依赖混淆攻击。它将在 packagist.org 上的包的公共版本高于来自私有仓库(如 repo.magento.com)的版本时检测到。当您尝试使用 composer 安装/更新包时,如果检测到潜在问题,插件将向您显示建议消息并停止该过程。
默认情况下,插件将遵循 composer.json 配置文件中的稳定性配置,该配置默认为 stable
。如果您想覆盖包的不稳定版本(dev、alpha、beta、RC),您可以更改 minimum-stability
级别或显式要求开发版本或仅beta版本,例如:’^1.0.2-beta1’
安装
composer require magento/composer-dependency-version-audit-plugin
使用
当您安装/更新 composer 时,如果检测到潜在的依赖混淆攻击,composer 插件将停止该过程。在这种情况下,composer install/update 将失败并显示类似以下错误消息:
Higher matching version x.x.x of package/name was found in public repository packagist.org than x.x.x in private.repo.
Public package might've been taken over by a malicious entity;
please investigate and update package requirement to match the version from the private repository.