8.8
CWE
88 94 77
Advisory Published
CVE Published
Updated

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

First published: Tue Apr 27 2021(Updated: )

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.

Credit: security-advisories@github.com security-advisories@github.com

Affected SoftwareAffected VersionHow to fix
composer/composer/composer>=2.0.0-alpha1<2.0.13<1.10.22
debian/composer
1.8.4-1+deb10u2
1.8.4-1+deb10u1
2.0.9-2+deb11u1
2.5.5-1
2.6.5-1
Getcomposer Composer<1.10.22
Getcomposer Composer>=2.0<2.0.13
Debian Debian Linux=9.0
Debian Debian Linux=10.0
Fedoraproject Fedora=33
Fedoraproject Fedora=34
composer/composer/composer>=2.0.0-alpha1<2.0.13
2.0.13
composer/composer/composer<1.10.22
1.10.22

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is CVE-2021-29472?

    CVE-2021-29472 is a vulnerability in Composer, a dependency manager for PHP, that allows code execution via specially crafted URLs for Mercurial repositories.

  • How does CVE-2021-29472 impact Composer?

    CVE-2021-29472 allows code to be executed in the HgDriver if hg/Mercurial is installed on the system.

  • Which versions of Composer are affected by CVE-2021-29472?

    Versions from 2.0.0-alpha1 to 2.0.13, and versions from 1.10.0 to 1.10.22 of Composer are affected by CVE-2021-29472.

  • How can I fix CVE-2021-29472 in Composer?

    To fix CVE-2021-29472, you should upgrade Composer to a version that is not affected by the vulnerability.

  • Where can I find more information about CVE-2021-29472?

    You can find more information about CVE-2021-29472 in the following references: [GitHub Security Advisory](https://github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx), [SonarSource Blog](https://blog.sonarsource.com/php-supply-chain-attack-on-composer/), [Composer Official Website](https://getcomposer.org/).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2024 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203