# 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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.8
- **CVSS:** 8.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, login needed
- **EPSS:** 4.75% (percentile 93, 2026-11-26)
- **CWE:** CWE-88, CWE-94
- **Aliases:** BIT-composer-2021-29472, GHSA-h5h8-pc6h-jvvx
- **Published:** 2021-04-27T20:30:15.000Z
- **Modified:** 2026-07-08T06:29:06.943Z

## 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

## 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

- Packagist `composer/composer`: affected \< 1.10.22; fixed 1.10.22, 2.0.13 (osv)
- composer: \< 1.10.22; \>=2.0,\<2.0.13 (cvelist)

## Mitigation

- Upgrade composer/composer to one of 1.10.22, 2.0.13 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.

## References

- vendor: <https://github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx>
- vendor: <https://getcomposer.org/>
- vendor: <https://www.debian.org/security/2021/dsa-4907>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FAQUAMGO4Q4BLNZ2OH4CXQD7UK4IO2GE/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KN3DMFH42BJW45VT6FYF2RXKC26D6VC2/>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-29472>
- exploit: <https://blog.sonarsource.com/php-supply-chain-attack-on-composer/>
- other: <https://lists.debian.org/debian-lts-announce/2021/05/msg00009.html>
- other: <https://blog.sonarsource.com/php-supply-chain-attack-on-composer>
- other: <https://github.com/FriendsOfPHP/security-advisories/blob/master/composer/composer/CVE-2021-29472.yaml>
- other: <https://github.com/composer/composer>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FAQUAMGO4Q4BLNZ2OH4CXQD7UK4IO2GE>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KN3DMFH42BJW45VT6FYF2RXKC26D6VC2>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-29472>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-h5h8-pc6h-jvvx> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-29472> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-29472>
