CVE-2021-29472: composer Argument Injection
Vulnerability summary
CVE-2021-29472 is a high (CVSS 8.8) Argument Injection vulnerability in composer. EPSS estimates a 4.75% chance of exploitation in the next 30 days, higher than 91.7% of scored vulnerabilities. 1 public exploit is recorded.
Timeline
- 27-04-2021PublishedVulnerability first disclosed.
- 03-08-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
5 scores · 4 sources · 2 versions- OSV · UbuntuEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- NVDNIST8.8HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
4.75%
Chance of exploitation in the next 30 days
Percentile
92%
Versus all other CVEs
30-day change
+0.09 pp
From 4.66% on 19-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
1 foundExploit Reference (blog.sonarsource.com)
Maturity: unknown
Weaknesses
CWE · root cause- CWE-88Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')The product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string.
- CWE-94Improper Control of Generation of Code ('Code Injection')The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
Affected systems
Opensuse3 products
- php-composer&distro=openSUSE Leap 15.2< 1.10.22-bp153.2.3.1
- php-composer&distro=openSUSE Leap 15.3< 1.10.22-bp153.2.3.1
- php-composer&distro=openSUSE Tumbleweed< 1.10.22-2.2
Suse3 products
- php-composer&distro=SUSE Package Hub 15 SP1< 1.10.22-bp153.2.3.1
- php-composer&distro=SUSE Package Hub 15 SP2< 1.10.22-bp153.2.3.1
- php-composer&distro=SUSE Package Hub 15 SP3< 1.10.22-bp153.2.3.1
Debian2 products
- composer< 2.0.9-2 | < 1.8.4-1+deb10u1 | < 1.2.2-1+deb9u1
- debian_linuxEOL9.0 | 10.0
Composer1 product
- composer< 1.10.22 | ≥ 2.0, < 2.0.13
Fedoraproject1 product
- fedoraEOL33 | 34
Getcomposer1 product
- composer< 1.10.22 | ≥ 2.0, < 2.0.13
Ubuntu1 product
- composer< 1.0.0~beta2-1ubuntu0.1~esm1 | < 1.6.3-1ubuntu0.1~esm1 | < 1.10.1-1ubuntu0.1~esm1
7 vendors · 12 products
References
16 links- github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvxX Refsource CONFIRMREPORTThird Party Advisory
- lists.debian.org/debian-lts-announce/2021/05/msg00009.htmlMailing ListX Refsource MLISTThird Party Advisory
- blog.sonarsource.com/php-supply-chain-attack-on-composer/X Refsource MISCExploitThird Party Advisory
- lists.opensuse.org/archives/…Advisory