CVE-2021-29472
Missing argument delimiter can lead to code execution via VCS repository URLs or source download URLs on systems with Mercurial in composer
Also known as BIT-composer-2021-29472, GHSA-h5h8-pc6h-jvvx
Mitigation
- Upgrade composer/composer to one of 1.10.22, 2.0.13 (or later in the same release line).
Who should check
- Projects that depend on Packagist package composer/composer (< 1.10.22)
- Anyone running composer < 1.10.22; >=2.0,<2.0.13
Vulnerability facts
- Affected
- composer/composer < 1.10.22
- Fixed in
- 1.10.22, 2.0.13
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- Yes: see the exploit references below
- Remote exploitation
- Remote, login needed
- CVSS
- 8.8 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 4.75% chance of exploitation in 30 days (percentile 93, 2026-11-26)
- CWE
- CWE-88, CWE-94
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Packagist composer/composer | < 1.10.22 | 1.10.22, 2.0.13 | osv |
| composer | < 1.10.22; >=2.0,<2.0.13 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-29472. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-29472.md Affected: composer/composer < 1.10.22 Fixed in: 1.10.22, 2.0.13 Steps: 1. Search this machine and project for composer/composer (Packagist), composer: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx
- https://getcomposer.org/
- https://www.debian.org/security/2021/dsa-4907
- 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://nvd.nist.gov/vuln/detail/CVE-2021-29472
Exploits and PoCs
Other
- https://lists.debian.org/debian-lts-announce/2021/05/msg00009.html
- https://blog.sonarsource.com/php-supply-chain-attack-on-composer
- https://github.com/FriendsOfPHP/security-advisories/blob/master/composer/composer/CVE-2021-29472.yaml
- https://github.com/composer/composer
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FAQUAMGO4Q4BLNZ2OH4CXQD7UK4IO2GE
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KN3DMFH42BJW45VT6FYF2RXKC26D6VC2
FAQ
Is CVE-2021-29472 being exploited?
There is no confirmed exploitation: CVE-2021-29472 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 4.75% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-29472?
High: CVSS 8.8 (v3.1, scored by CNA). Remote, login needed.
Which versions are affected by CVE-2021-29472?
composer/composer < 1.10.22.
Is there a fix for CVE-2021-29472?
Yes. Fixed in 1.10.22, 2.0.13. Upgrade composer/composer to one of 1.10.22, 2.0.13 (or later in the same release line).
How do I check if I'm affected by CVE-2021-29472?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.