Code Injection in composer - CVE-2021-29472

 

Code Injection in composer - CVE-2021-29472

Published: April 30, 2021


Vulnerability identifier: #VU52777
CSH Severity: High
CVSS v4: 9.3 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2021-29472
CWE-ID: CWE-94
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The vulnerability exists due to improper input validation of URLs for Mercurial repositories in the root composer.json and package source download URLs. A remote attacker can inject a specially crafted URL that will allow command execution in the HgDriver if hg/Mercurial is installed on the system.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.


Affected software

composer
composer (Debian package)
composer
Fedora

How to mitigate CVE-2021-29472

Install updates from vendor's website.

composer - addressed in versions 1.10.22, 2.0.13
composer (Debian package) - update to 1.8.4-1+deb10u1
composer - addressed in versions 1.10.22-1.el7, 1.10.22-1.fc32, 2.0.13-1.fc33, 2.0.13-1.fc34

External References

Related Security Bulletins