Every CVE Search/ Get API key

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

8.8 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

4.75%Up 3.4 points since Apr 28, 2021
90%50%10%1%

What each source reports

CVE List Score used 8.8

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

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.

Record
CVE-2021-29472
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-88, CWE-94
Updated
2026-11-02
EUVDEUVD-2021-0829 8.8

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.

Record
EUVD-2021-0829
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-h5h8-pc6h-jvvx 8.8

Composer's missing argument delimiter can lead to code execution via VCS repository URLs or source download URLs on systems with Mercurial

URLs for Mercurial repositories in the root composer.json and package source download URLs are not sanitized correctly. Specifically crafted URL values allow commands to be executed in the HgDriver if hg/Mercurial is installed on the system.

Impact

  • 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 command injection. 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

Patches

1.10.22 and 2.0.13 include patches for this issue.

Record
GHSA-h5h8-pc6h-jvvx
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-88, CWE-94
Updated
2026-11-02
NVD 8.8

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.

Record
CVE-2021-29472
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
6.5 MediumAV:N/AC:L/Au:S/C:P/I:P/A:P
Weakness
CWE-88, CWE-94
Updated
2026-11-02
OSVALPINE-CVE-2021-29472 8.8

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.

Record
ALPINE-CVE-2021-29472
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-03
OSV 8.8

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.

Record
CVE-2021-29472
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
Show 7 moreShow less
OSVDEBIAN-CVE-2021-29472 8.8

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.

Record
DEBIAN-CVE-2021-29472
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVGHSA-h5h8-pc6h-jvvx 8.8

Composer's missing argument delimiter can lead to code execution via VCS repository URLs or source download URLs on systems with Mercurial

URLs for Mercurial repositories in the root composer.json and package source download URLs are not sanitized correctly. Specifically crafted URL values allow commands to be executed in the HgDriver if hg/Mercurial is installed on the system.

Impact

  • 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 command injection. 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

Patches

1.10.22 and 2.0.13 include patches for this issue.

Record
GHSA-h5h8-pc6h-jvvx
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-88, CWE-94
Updated
2026-11-02
OSVUBUNTU-CVE-2021-29472 8.8

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.

Record
UBUNTU-CVE-2021-29472
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVBIT-composer-2021-29472 No score

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

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.

Record
BIT-composer-2021-29472
Updated
2026-11-02
OSVopenSUSE-SU-2021:1289-1 No score

Security update for php-composer

This update for php-composer fixes the following issues:

  • Require php-mbstring as requested in boo#1187416

  • Version 1.10.22

    • Security: Fixed command injection vulnerability in HgDriver/HgDownloader and hardened other VCS drivers and downloaders (GHSA-h5h8-pc6h-jvvx / CVE-2021-29472), boo#1185376
  • Version 1.10.21

    • Fixed support for new GitHub OAuth token format
    • Fixed processes silently ignoring the CWD when it does not exist
  • Version 1.10.20

    • Fixed exclude-from-classmap causing regex issues when having too many paths
    • Fixed compatibility issue with Symfony 4/5
  • Version 1.10.17

    • Fixed Bitbucket API authentication issue
    • Fixed parsing of Composer 2 lock files breaking in some rare conditions
  • Version 1.10.16

    • Added warning to validate command for cases where packages provide/ replace a package that they also require
    • Fixed JSON schema validation issue with PHPStorm
    • Fixed symlink handling in archive command
  • Version 1.10.15

    • Fixed path repo version guessing issue
  • Version 1.10.14

    • Fixed version guesser to look at remote branches as well as local ones
    • Fixed path repositories version guessing to handle edge cases where version is different from the VCS-guessed version
    • Fixed COMPOSER env var causing issues when combined with the global command
    • Fixed a few issues dealing with PHP without openssl extension (not recommended at all but sometimes needed for testing)
  • Version 1.10.13

    • Fixed regressions with old version validation
    • Fixed invalid root aliases not being reported
  • Version 1.10.12

    • Fixed regressions with old version validation
  • Version 1.10.11

    • Fixed more PHP 8 compatibility issues
    • Fixed regression in handling of CTRL-C when xdebug is loaded
    • Fixed status handling of broken symlinks
  • Version 1.10.10

    • Fixed create-project not triggering events while installing the root package
    • Fixed PHP 8 compatibility issue
    • Fixed self-update to avoid automatically upgrading to the next major version once it becomes stable
  • Version 1.10.9

    • Fixed Bitbucket redirect loop when credentials are outdated
    • Fixed GitLab auth prompt wording
    • Fixed self-update handling of files requiring admin permissions to write to on Windows (it now does a UAC prompt)
    • Fixed parsing issues in funding.yml files
  • Version 1.10.8

    • Fixed compatibility issue with git being configured to show signatures by default
    • Fixed discarding of local changes when updating packages to include untracked files
    • Several minor fixes
  • Version 1.10.7

    • Fixed PHP 8 deprecations
    • Fixed detection of pcntl_signal being in disabled_functions when pcntl_async_signal is allowed
  • Version 1.10.6

    • Fixed version guessing to take composer-runtime-api and composer-plugin-api requirements into account to avoid selecting packages which require Composer 2
    • Fixed package name validation to allow several dashes following each other
    • Fixed post-status-cmd script not firing when there were no changes to be displayed
    • Fixed composer-runtime-api support on Composer 1.x, the package is now present as 1.0.0
    • Fixed support for composer show --name-only --self
    • Fixed detection of GitLab URLs when handling authentication in some cases
  • Version 1.10.5

    • Fixed self-update on PHP <5.6, seriously please upgrade
    • Fixed 1.10.2 regression with PATH resolution in scripts
  • Version 1.10.4

    • Fixed 1.10.2 regression in path symlinking with absolute path repos
  • Version 1.10.3

    • Fixed invalid --2 flag warning in self-update when no channel is requested
  • Version 1.10.2

    • Added --1 flag to self-update command which can be added to automated self-update runs to make sure it won't automatically jump to 2.0 once that is released
    • Fixed path repository symlinks being made relative when the repo url is defined as absolute paths
    • Fixed potential…
Record
openSUSE-SU-2021:1289-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:11166-1 No score

php-composer-1.10.22-2.2 on GA media

These are all security issues fixed in the php-composer-1.10.22-2.2 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11166-1
Updated
2026-11-02
OSVUSN-5220-1 No score

composer vulnerability

It was discovered that Composer did not properly sanitize URLs for Mercurial repositories in the root composer.json and package source download URLs. A remote attacker could possibly use this issue to execute arbitrary code.

Record
USN-5220-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
composer/composer
Packagist
before 1.10.22
1.10.22
composer/composer
Packagist
2.0.0-alpha1 up to 2.0.13
2.0.13
composer
Alpine:v3.13
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.14
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.15
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.16
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.17
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.18
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.19
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.20
2.0 up to 2.0.13-r0
2.0.13-r0
Show 21 moreShow less
Affected packages
PackageAffectedFixed
composer
Alpine:v3.21
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.22
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.23
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Alpine:v3.24
2.0 up to 2.0.13-r0
2.0.13-r0
composer
Bitnami
before 1.10.22, 2.0.0 up to 2.0.13
1.10.222.0.13
composer
Debian:12
before 2.0.9-2
2.0.9-2
composer
Debian:13
before 2.0.9-2
2.0.9-2
composer
Debian:14
before 2.0.9-2
2.0.9-2
composer
Debian:9
before 1.2.2-1+deb9u1, plus listed versions
1.2.2-1
1.2.2-1+deb9u1
composer
Debian:10
before 1.8.4-1+deb10u1, plus listed versions
1.8.4-1
1.8.4-1+deb10u1
composer/composer
Packagist
before 1.10.22, plus listed versions
1.0.01.0.0-alpha11.0.0-alpha101.0.0-alpha111.0.0-alpha2
Show 45 moreShow less
1.0.0-alpha31.0.0-alpha41.0.0-alpha51.0.0-alpha61.0.0-alpha71.0.0-alpha81.0.0-alpha91.0.0-beta11.0.0-beta21.0.11.0.21.0.31.1.01.1.0-RC1.1.11.1.21.1.31.10.01.10.0-RC1.10.11.10.101.10.111.10.121.10.131.10.141.10.151.10.161.10.171.10.181.10.191.10.21.10.201.10.211.10.31.10.41.10.51.10.61.10.71.10.81.10.91.2.01.2.0-RC1.2.11.2.21.2.3
1.10.22
composer/composer
Packagist
2.0.0-alpha1 up to 2.0.13, plus listed versions
2.0.02.0.0-RC12.0.0-RC22.0.0-alpha22.0.0-alpha3
Show 12 moreShow less
2.0.12.0.102.0.112.0.122.0.22.0.32.0.42.0.52.0.62.0.72.0.82.0.9
2.0.13
composer
Ubuntu:Pro:16.04:LTS
before 1.0.0~beta2-1ubuntu0.1~esm1, plus listed versions
1.0.0~alpha10+20150602-11.0.0~alpha10+20150602-21.0.0~alpha11-11.0.0~alpha11-1ubuntu11.0.0~alpha11-21.0.0~alpha11-31.0.0~beta1-1ubuntu11.0.0~beta2-1
1.0.0~beta2-1ubuntu0.1~esm1
composer
Ubuntu:Pro:18.04:LTS
before 1.6.3-1ubuntu0.1~esm1, plus listed versions
1.5.1-11.5.2-11.6.2-11.6.3-1
1.6.3-1ubuntu0.1~esm1
composer
Ubuntu:Pro:20.04:LTS
before 1.10.1-1ubuntu0.1~esm1, plus listed versions
1.9.0-21.9.1-11.9.2-11.9.3-11.10.0-11.10.1-1
1.10.1-1ubuntu0.1~esm1
php-composer
SUSE:Package Hub 15 SP1
before 1.10.22-bp153.2.3.1
1.10.22-bp153.2.3.1
php-composer
SUSE:Package Hub 15 SP2
before 1.10.22-bp153.2.3.1
1.10.22-bp153.2.3.1
php-composer
SUSE:Package Hub 15 SP3
before 1.10.22-bp153.2.3.1
1.10.22-bp153.2.3.1
php-composer
openSUSE:Leap 15.2
before 1.10.22-bp153.2.3.1
1.10.22-bp153.2.3.1
php-composer
openSUSE:Leap 15.3
before 1.10.22-bp153.2.3.1
1.10.22-bp153.2.3.1
php-composer
openSUSE:Tumbleweed
before 1.10.22-2.2
1.10.22-2.2

History

History
RecordedChangedSources
affected, aliases, referencesOSV
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-29472 is a high vulnerability (CVSS 8.8) in Composer, published April 27, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 4.75%, the 91st percentile. Fixed in composer/composer 1.10.22.

References

Show 17 moreShow less
This page doesn't list everything

Left out here: 40 versions and the rest of 1 source description. The JSON record has them.

MoveEnter Open