Read the docs
TI-2021-10185 Aliases CVE-2021-29472GHSA-h5h8-pc6h-jvvx

Code injection in composer

Priority MEDIUM 46CWE-88Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
User interaction
None
Attack complexity
Low
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-88.

Summary

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.

Why it matters now

EPSS 0.04752 91st percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Fixed composer (composer): 1.10.22, 2.0.13composer/composer (Packagist): 1.10.22, 2.0.13

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
composercomposerbefore 1.10.22; 2.0 to before 2.0.131.10.22, 2.0.13Patch availableCNA
—composer/composer (Packagist)before 1.10.221.10.22Patch availableGHSA-h5h8-pc6h-jvvx
—composer/composer (Packagist)2.0.0-alpha1 to before 2.0.132.0.13Patch availableGHSA-h5h8-pc6h-jvvx
  • composer Vendorcomposer Affected before 1.10.22; 2.0 to before 2.0.13 Fixed in 1.10.22, 2.0.13 Patch available CNA
  • composer/composer (Packagist) Vendor— Affected before 1.10.22 Fixed in 1.10.22 Patch available GHSA-h5h8-pc6h-jvvx
  • composer/composer (Packagist) Vendor— Affected 2.0.0-alpha1 to before 2.0.13 Fixed in 2.0.13 Patch available GHSA-h5h8-pc6h-jvvx

CPE configurations NVD · 5

CPEVersionsRoleVendor
cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:*before 1.10.22; 2.0 to before 2.0.13Vulnerablecomposer
cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*9.0VulnerableDebian
cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*10.0VulnerableDebian
cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*33VulnerableFedoraproject
cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*34VulnerableFedoraproject
  • cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:* Versions before 1.10.22; 2.0 to before 2.0.13 Vulnerable ·composer
  • cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
  • cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
  • cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* Versions 33 Vulnerable ·Fedoraproject
  • cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject

Remediation

  • Fix · CNA composer (composer) Fixed in 1.10.22, 2.0.13
  • Fix · GHSA-h5h8-pc6h-jvvx composer/composer (Packagist) Fixed in 1.10.22 Advisory →
  • Fix · GHSA-h5h8-pc6h-jvvx composer/composer (Packagist) Fixed in 2.0.13 Advisory →

Vendor assessments

Red Hat

Red Hat's page for this CVE →

Not affected: 1 product
  • Red Hat

Timeline

  1. 2026-10-02 Threatist record created from CVE-2021-29472
  2. 2026-10-03 Alias added: GHSA-h5h8-pc6h-jvvx

References

  • TI-2015-06892 Composer before 2016-02-10 allows cache poisoning from other projects built on the same… CVSS 3.1HIGH 8.8
  • TI-2021-17955 Command injection in composer on Windows CVSS 3.1CRITICAL 9.8
  • TI-2022-08641 Missing input validation can lead to command execution in composer CVSS 3.1HIGH 8.8
  • TI-2026-29055 Composer has Command Injection via Malicious Perforce Reference CVSS 3.1HIGH 8.8
  • TI-2023-23380 Remote Code Execution via web-accessible composer.phar CVSS 3.1HIGH 8.8
  • TI-2024-16338 Code execution and possible privilege escalation via compromised InstalledVersions.php or installed.php in Composer CVSS 3.1HIGH 8.8
See all 8 →

Sources