// For flags

CVE-2021-29472

Missing argument delimiter can lead to code execution via VCS repository URLs or source download URLs on systems with Mercurial in composer

Severity Score

8.8
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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.

Composer es un administrador de dependencias para PHP. Las URL de los repositorios de Mercurial en la root composer.json y las URL de descarga de la fuente del paquete no se sanean correctamente. Los valores de URL específicamente diseñados permiten que el código se ejecute en HgDriver si hg/Mercurial está instalado en el sistema. El impacto para usuarios de Composer directamente es limitado ya que el archivo composer.json generalmente está bajo su propio control y las URL de descarga de origen solo pueden ser proporcionadas por repositorios de Composer de terceros en los que confían explícitamente para descargar y ejecutar el código fuente, por ejemplo, complementos de Composer. El principal impacto es en los servicios que pasan la entrada del usuario a Composer, incluidos Packagist.org y Private Packagist. Esto permitió a usuarios activar la ejecución remota de código. La vulnerabilidad se ha corregido en Packagist. org y Private Packagist dentro de las 12 horas posteriores a la recepción del informe de vulnerabilidad inicial y, en base a una revisión de los registros, hasta donde sabemos, nadie abusó de ella. Otros servicios y herramientas que usan VcsRepository/VcsDriver o derivados también pueden ser vulnerables y deberían actualizar su dependencia de compositor/compositor de inmediato. Las versiones 1.10.22 y 2.0.13 incluyen parches para este problema

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Network
Attack Complexity
Low
Authentication
Single
Confidentiality
Partial
Integrity
Partial
Availability
Partial
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2021-03-30 CVE Reserved
  • 2021-04-27 CVE Published
  • 2024-05-30 EPSS Updated
  • 2024-08-03 CVE Updated
  • 2024-08-03 First Exploit
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
  • CWE-94: Improper Control of Generation of Code ('Code Injection')
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Getcomposer
Search vendor "Getcomposer"
Composer
Search vendor "Getcomposer" for product "Composer"
< 1.10.22
Search vendor "Getcomposer" for product "Composer" and version " < 1.10.22"
-
Affected
Getcomposer
Search vendor "Getcomposer"
Composer
Search vendor "Getcomposer" for product "Composer"
>= 2.0 < 2.0.13
Search vendor "Getcomposer" for product "Composer" and version " >= 2.0 < 2.0.13"
-
Affected
Debian
Search vendor "Debian"
Debian Linux
Search vendor "Debian" for product "Debian Linux"
9.0
Search vendor "Debian" for product "Debian Linux" and version "9.0"
-
Affected
Debian
Search vendor "Debian"
Debian Linux
Search vendor "Debian" for product "Debian Linux"
10.0
Search vendor "Debian" for product "Debian Linux" and version "10.0"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Fedora
Search vendor "Fedoraproject" for product "Fedora"
33
Search vendor "Fedoraproject" for product "Fedora" and version "33"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Fedora
Search vendor "Fedoraproject" for product "Fedora"
34
Search vendor "Fedoraproject" for product "Fedora" and version "34"
-
Affected