CVE-2021-29472Missing argument delimiter can lead to code execution via VCS repository URLs or source…
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.
What to do
Fixed builds are available from Alpine, Debian, Packagist: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 20.04 | composer | Fix pending | 1.10.1-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-29472 |
| Ubuntu 18.04 | composer | Fix pending | 1.6.3-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-29472 |
| Ubuntu 16.04 | composer | Fix pending | 1.0.0~beta2-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-29472 |
| Debian 14 | composer | Fixed | 2.0.9-2 | DEBIAN-CVE-2021-29472 |
| Debian 13 | composer | Fixed | 2.0.9-2 | DEBIAN-CVE-2021-29472 |
| Debian 12 | composer | Fixed | 2.0.9-2 | DEBIAN-CVE-2021-29472 |
| Alpine Linux 3.24 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.23 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.22 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.21 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.20 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.19 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.18 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.17 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.16 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.15 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.14 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Alpine Linux 3.13 | composer | Fixed | 2.0.13-r0 | ALPINE-CVE-2021-29472 |
| Packagist library | composer/composer | Fixed | 1.10.22 | GHSA-h5h8-pc6h-jvvx |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- composer: affected: < 1.10.22, >=2.0,<2.0.13
Vendor advisories:
- https://www.debian.org/security/2021/dsa-4907 (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://github.com/composer/composer/security/advisories/GHSA-h5h8-pc6h-jvvx
- https://getcomposer.org/
- https://www.debian.org/security/2021/dsa-4907
- https://lists.debian.org/debian-lts-announce/2021/05/msg00009.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FAQUAMGO4Q4BLNZ2OH4CXQD7UK4IO2GE/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KN3DMFH42BJW45VT6FYF2RXKC26D6VC2/
- https://blog.sonarsource.com/php-supply-chain-attack-on-composer/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.