Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. composer/composer
  4. ›
  5. CVE-2021-29472

CVE-2021-29472: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

April 29, 2021 (updated May 27, 2021)

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.

References

  • getcomposer.org/
  • github.com/advisories/GHSA-h5h8-pc6h-jvvx
  • github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx
  • lists.debian.org/debian-lts-announce/2021/05/msg00009.html
  • lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FAQUAMGO4Q4BLNZ2OH4CXQD7UK4IO2GE/
  • lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KN3DMFH42BJW45VT6FYF2RXKC26D6VC2/
  • nvd.nist.gov/vuln/detail/CVE-2021-29472
  • www.debian.org/security/2021/dsa-4907

Code Behaviors & Features

Detect and mitigate CVE-2021-29472 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.10.22, all versions starting from 2.0 before 2.0.13

Fixed versions

  • 1.10.22
  • 2.0.13

Solution

Upgrade to versions 1.10.22, 2.0.13 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
  • CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

packagist/composer/composer/CVE-2021-29472.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:33 +0000.