cve.bz

CVE-2021-29472 Argument Injection

8.8 highExploit referenceEPSS 4.8%Fix available

High (8.8). EPSS 4.8% estimated probability of exploitation activity in the next 30 days. Fixed in composer/composer 1.10.22, 2.0.13.

On this page
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.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
4.8% (unchanged from 4.8% a week ago; 4.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 92nd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-88 Improper Neutralization of Argument Delimiters in a Command (Argument Injection)
CWE-94 Improper Control of Generation of Code (Code Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-29472 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-29472?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-29472?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-29472 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
getcomposer:composerbefore 1.10.22
getcomposer:composerfrom 2.0 before 2.0.13
debian:debian_linux9.0
debian:debian_linux10.0
fedoraproject:fedora33
fedoraproject:fedora34

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-h5h8-pc6h-jvvxPackagistcomposer/composer<1.10.221.10.22
GHSA-h5h8-pc6h-jvvxPackagistcomposer/composer>=2.0.0-alpha1 <2.0.132.0.13

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9composer1.2.2-1+deb9u1DLA-2654-1
Debian10composer1.8.4-1+deb10u1DSA-4907-1
Debian12, 13, 14composer2.0.9-2DEBIAN-CVE-2021-29472
UbuntuPro:16.04:LTScomposer1.0.0~beta2-1ubuntu0.1~esm1UBUNTU-CVE-2021-29472 USN-5220-1
UbuntuPro:18.04:LTScomposer1.6.3-1ubuntu0.1~esm1UBUNTU-CVE-2021-29472 USN-5220-1
UbuntuPro:20.04:LTScomposer1.10.1-1ubuntu0.1~esm1UBUNTU-CVE-2021-29472 USN-5220-1
SUSEPackage Hub 15 SP1, Package Hub 15 SP2, Package Hub 15 SP3php-composer1.10.22-bp153.2.3.1openSUSE-SU-2021:1289-1
openSUSELeap 15.2, Leap 15.3php-composer1.10.22-bp153.2.3.1openSUSE-SU-2021:1289-1
openSUSETumbleweedphp-composer1.10.22-2.2openSUSE-SU-2024:11166-1
Alpinev3.13, v3.14, v3.15 and 9 morecomposer2.0.13-r0ALPINE-CVE-2021-29472

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpine.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High
  • CAPEC-41 Using Meta-characters in E-mail Headers to Inject Malicious Payloads Likelihood: High · Severity: High
  • CAPEC-88 OS Command Injection Likelihood: High · Severity: High
  • CAPEC-137 Parameter Injection Likelihood: Medium · Severity: Medium
  • CAPEC-174 Flash Parameter Injection Likelihood: High · Severity: Medium
  • CAPEC-460 HTTP Parameter Pollution (HPP) Severity: Medium

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON