CVE-2021-29472
What it is
Composer is a dependency manager for PHP. URLs for Mercurial repositories in the root composer.json and package source download URLs are not sanitized correctly. Specifically crafted URL values allow code to be executed in the HgDriver if hg/Mercurial is installed on the system. The impact to Composer users directly is limited as the composer.json file is typically under their own control and source download URLs can only be supplied by third party Composer repositories they explicitly trust to download and execute source code from, e.g. Composer plugins. The main impact is to services passing user input to Composer, including Packagist.org and Private Packagist. This allowed users to trigger remote code execution. The vulnerability has been patched on Packagist.org and Private Packagist within 12h of receiving the initial vulnerability report and based on a review of logs, to the best of our knowledge, was not abused by anyone. Other services/tools using VcsRepository/VcsDriver or derivatives may also be vulnerable and should upgrade their composer/composer dependency immediately. Versions 1.10.22 and 2.0.13 include patches for this issue.
At a glance
- Exploitability
- Can be exploited over the network with a low-privilege account. High risk of data exposure, data tampering, service disruption.
- Exploit odds
- 4.8% chance of exploitation in the next 30 days (EPSS).
- Fix
- A patch, advisory or fixed version is referenced. Upgrade or apply it.
Timeline
- PublishedDisclosed publicly on CVE.org and NVD
- Last updatedMost recent change to the record
Why it ranks here
- Exploited in the wild: no, CISA does not list it.
- Exploit odds: 4.8% in the next 30 days (EPSS).
- Severity: 8.8 HIGH (CVSS).
- Fix: a patch or advisory is linked.
Details
- Published
- Last modified
- Exploit probability
- 4.8% · EPSS, next 30 days
- Weakness
- CWE-88
- Record status
- Modified
Affected
- Getcomposer Composer < 1.10.22
- Getcomposer Composer < 2.0.13
- Debian Linux 9.0
- Debian Linux 10.0
- Fedoraproject Fedora 33
- Fedoraproject Fedora 34
Attack profile CVSS 3.1 · 8.8
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Raw vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Is it in your code?
Hand this to your coding agent. It searches your project for the affected products and checks versions. Nothing leaves your machine.
Read https://cve-list.com/agent/cve/CVE-2021-29472.md and follow it. Check whether this project is affected by CVE-2021-29472. Read only. Don't change anything and don't upload my code. Tell me yes, no or not sure, with the file as proof.
Fix and advisories
- https://getcomposer.org/
- https://github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx
- https://getcomposer.org/
- https://github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx
References
- https://blog.sonarsource.com/php-supply-chain-attack-on-composer/
- https://getcomposer.org/
- https://github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx
- https://lists.debian.org/debian-lts-announce/2021/05/msg00009.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FAQUAMGO4Q4BLNZ2OH4CXQD7UK4IO2GE/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KN3DMFH42BJW45VT6FYF2RXKC26D6VC2/
- https://www.debian.org/security/2021/dsa-4907
- https://blog.sonarsource.com/php-supply-chain-attack-on-composer/
- https://getcomposer.org/
- https://github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx
- https://lists.debian.org/debian-lts-announce/2021/05/msg00009.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FAQUAMGO4Q4BLNZ2OH4CXQD7UK4IO2GE/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KN3DMFH42BJW45VT6FYF2RXKC26D6VC2/
- https://www.debian.org/security/2021/dsa-4907