CVE-2021-29472 in Debian Linux and 2 more products
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...
Affects 3 products from 3 vendors. Facts below cite their sources.
Remotely exploitable over the network, low complexity, low privileges required, no user interaction needed, impact contained to the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Debian | Debian Linux | 9.0 10.0 |
| Fedoraproject | Fedora | 33 34 |
| Getcomposer | Composer | < 1.10.22 ≥ 2.0, < 2.0.13 |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
Vendor PSIRT: [email protected]
Exploitation
| CISA known-exploited | Not in the CISA KEV catalog |
|---|---|
| Public exploit | Not confirmed |
Official 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.
Source: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2021-29472 |
|---|---|
| BreachSpider ID | BS-2021-GLOBAL-264243-H |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| Published | 2021-04-27 |
| Last modified | 2026-06-17 |
| Weakness (CWE) | |
| Source | NVD |
Weakness definitions
CWE-88: CWE-88
CWE-94: Code Injection
Attacker injects arbitrary code that is executed by the application process.
Related attack patterns (CAPEC)
CAPEC-35 Leverage Executable Code in Non-Executable Files via CWE-94
CAPEC-41 Using Meta-characters in E-mail Headers to Inject Malicious Payloads via CWE-88
CAPEC-174 Flash Parameter Injection via CWE-88
CAPEC-460 HTTP Parameter Pollution (HPP) via CWE-88
CAPEC-77 Manipulating User-Controlled Variables via CWE-94
Show all 8
CAPEC-88 OS Command Injection via CWE-88
CAPEC-137 Parameter Injection via CWE-88
CAPEC-242 Code Injection via CWE-94
Mapping is CWE to CAPEC per MITRE CAPEC 3.9.
Analysis AI-written, not human-reviewed
CVE-2021-29472 affects Composer, a PHP dependency manager, due to unsanitized URLs for Mercurial repositories in the root composer.json and package source download URLs. This can lead to code execution if Mercurial is installed on the system.
An attacker can craft specific URL values in the composer.json file to execute arbitrary code through the HgDriver if Mercurial is installed. This requires the attacker to have control over the composer.json file or the package source download URLs.
Questions
What is CVE-2021-29472?
CVE-2021-29472 affects Composer, a PHP dependency manager, due to unsanitized URLs for Mercurial repositories in the root composer.json and package source download URLs. This can lead to code execution if Mercurial is installed on the system.
What is the CVSS score for CVE-2021-29472?
CVE-2021-29472 has CVSS 8.8 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. EPSS: 4.8%.
Is CVE-2021-29472 actively exploited?
No confirmed active exploitation of CVE-2021-29472 as of 2026-09-25.
How do I remediate CVE-2021-29472?
Priority: HIGH. Advisory: https://getcomposer.org/ PSIRT: [email protected]
What systems are affected by CVE-2021-29472?
CVE-2021-29472 affects Debian Debian Linux; Fedoraproject Fedora; Getcomposer Composer.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Debian","product":"Debian Linux","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.