Every CVE Search/ Get API key

CVE-2022-24828

Missing input validation can lead to command execution in composer

8.3 HighFix available

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call VcsDriver::getFileContent can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

1.89%Up 1.0 points since Apr 14, 2022
90%50%10%1%

What each source reports

CVE List Score used 8.3

Missing input validation can lead to command execution in composer

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call VcsDriver::getFileContent can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

Record
CVE-2022-24828
CVSS 3.1
8.3 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
Weakness
CWE-20
Updated
2026-11-02
EUVDEUVD-2022-1866 8.3

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call VcsDriver::getFileContent can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

Record
EUVD-2022-1866
CVSS 3.1
8.3 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-x7cr-6qr6-2hh6 8.3

Missing input validation can lead to command execution in composer

The Composer method VcsDriver::getFileContent() with user-controlled $file or $identifier arguments is susceptible to an argument injection vulnerability. It can be leveraged to gain arbitrary command execution if the Mercurial or the Git driver are used.

This led to a vulnerability on Packagist.org and Private Packagist, i.e., using the composer.json readme field as a vector for injecting parameters into the $file argument for the Mercurial driver or via the $identifier argument for the Git and Mercurial drivers.

Composer itself can be attacked through branch names by anyone controlling a Git or Mercurial repository, which is explicitly listed by URL in a project's composer.json.

To the best of our knowledge, this was not actively exploited. The vulnerability has been patched on Packagist.org and Private Packagist within a day of the vulnerability report.

Record
GHSA-x7cr-6qr6-2hh6
CVSS 3.1
8.3 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
Weakness
CWE-20, CWE-88, CWE-94
Updated
2026-11-02
NVD 8.3

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call VcsDriver::getFileContent can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

Record
CVE-2022-24828
CVSS 3.1
8.3 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CVSS 2.0
6.8 MediumAV:N/AC:M/Au:N/C:P/I:P/A:P
Weakness
CWE-20, CWE-88
Updated
2026-11-02
OSVALPINE-CVE-2022-24828 8.8

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call VcsDriver::getFileContent can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

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

Missing input validation can lead to command execution in composer

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call VcsDriver::getFileContent can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

Record
CVE-2022-24828
CVSS 3.1
8.3 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
Weakness
CWE-20
Updated
2026-11-02
Show 10 moreShow less
OSVDEBIAN-CVE-2022-24828 8.8

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call VcsDriver::getFileContent can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

Record
DEBIAN-CVE-2022-24828
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-03
OSVGHSA-x7cr-6qr6-2hh6 8.3

Missing input validation can lead to command execution in composer

The Composer method VcsDriver::getFileContent() with user-controlled $file or $identifier arguments is susceptible to an argument injection vulnerability. It can be leveraged to gain arbitrary command execution if the Mercurial or the Git driver are used.

This led to a vulnerability on Packagist.org and Private Packagist, i.e., using the composer.json readme field as a vector for injecting parameters into the $file argument for the Mercurial driver or via the $identifier argument for the Git and Mercurial drivers.

Composer itself can be attacked through branch names by anyone controlling a Git or Mercurial repository, which is explicitly listed by URL in a project's composer.json.

To the best of our knowledge, this was not actively exploited. The vulnerability has been patched on Packagist.org and Private Packagist within a day of the vulnerability report.

Record
GHSA-x7cr-6qr6-2hh6
CVSS 3.1
8.3 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
Weakness
CWE-20, CWE-88, CWE-94
Updated
2026-11-02
OSVUBUNTU-CVE-2022-24828 8.3

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call VcsDriver::getFileContent can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

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

Missing input validation can lead to command execution in composer

Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call VcsDriver::getFileContent can have a code injection vulnerability if the user can control the $file or $identifier argument. This leads to a vulnerability on packagist.org for example where the composer.json's readme field can be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or git via the $identifier argument if you allow arbitrary data there (Packagist does not, but maybe other integrators do). Composer itself should not be affected by the vulnerability as it does not call getFileContent with arbitrary data into $file/$identifier. To the best of our knowledge this was not abused, and the vulnerability has been patched on packagist.org and Private Packagist within a day of the vulnerability report.

Record
BIT-composer-2022-24828
Updated
2026-11-02
OSVopenSUSE-SU-2022:0132-1 No score

Security update for php-composer

This update for php-composer fixes the following issues:

php-composer was updated to version 1.10.26:

  • Security: Fixed command injection vulnerability in HgDriver/GitDriver: CVE-2022-24828 boo#1198494

Update to version 1.10.25

  • Fix regression with PHP 8.1.0 and 8.1.1

Update to version 1.10.24

  • Fixed PHP 8.1 compatibility

Update to version 1.10.23

  • Security: Fixed command injection vulnerability CVE-2021-41116
Record
openSUSE-SU-2022:0132-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:12048-1 No score

php-composer2-2.3.5-1.1 on GA media

These are all security issues fixed in the php-composer2-2.3.5-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:12048-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:12054-1 No score

php-composer-1.10.26-1.1 on GA media

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

Record
openSUSE-SU-2024:12054-1
Updated
2026-11-02
OSVSUSE-SU-2022:3020-1 No score

Security update for php-composer2

This update for php-composer2 fixes the following issues:

  • CVE-2022-24828: Fixed a code injection issue that affected integrators using specific APIs to read untrusted input files (bsc#1198494).
Record
SUSE-SU-2022:3020-1
Updated
2026-11-02
OSVSUSE-SU-2026:1970-1 No score

Security update for php-composer2

This update for php-composer2 fixes the following issues

  • CVE-2026-40176: command injection via malicious Perforce repository definition (bsc#1262254).
  • CVE-2026-40261: command injection via malicious Perforce source reference/url (bsc#1262255).

Changes for php-composer2:

  • version update to 2.2.27 (align with upstream LTS version)
  • Security: Hardened git/hg/perforce/fossil identifier validation to ensure branch names starting with - do not cause issues (246f807b, 246f807b, 246f807b)
  • Security: Fixed Perforce unescaped user input in queryP4User shell command (246f807b)
  • Security: Fixed usage of insecure 3DES ciphers when ext-curl is missing (21ffece62)
  • Fixed issue handling paths with = in them on Windows (#11568)
  • version 2.2.26 2025-12-30
  • Security: Fixed ANSI sequence injection (GHSA-59pp-r3rg-353g / CVE-2025-67746)
  • version 2.2.25 2024-12-11
  • Fixed deprecation notices appearing on this LTS version in case it is used on modern PHP. Modern PHP support is not guaranteed nor tested for though and the main purpose of LTS releases is legacy PHP versions support. (#12217)
  • Fixed issue on plugin upgrade when it defines multiple classes (#12226)
  • Fixed duplicate errors appearing in the output depending on php settings (#12214)
  • Fixed InstalledVersions returning duplicate data in some instances (#12225)
  • version 2.2.24 2024-06-10
  • Security: Fixed command injection via malicious git branch name (GHSA-47f6-5gq3-vx9c / CVE-2024-35241)
  • Security: Fixed multiple command injections via malicious git/hg branch names (GHSA-v9qv-c7wm-wgmf / CVE-2024-35242)
  • Security: Fixed secure-http checks that could be bypassed by using malformed URL formats (fa3b9582c)
  • Security: Fixed Filesystem::isLocalPath including windows-specific checks on linux (3c37a67c)
  • Security: Fixed perforce argument escaping (3773f775)
  • Security: Fixed handling of zip bombs when extracting archives (de5f7e32)
  • Security: Fixed Windows command parameter escaping to prevent abuse of unicode characters with best fit encoding
  • conversion (3130a7455, 04a63b324)
  • version 2.2.23 2024-02-08
  • Security: Fixed code execution and possible privilege escalation via compromised vendor dir contents (GHSA-7c6p-848j-wh5h / CVE-2024-24821)
  • version 2.2.22 2023-09-29
  • Security: Fixed possible remote code execution vulnerability if composer.phar is publicly accessible, executable as PHP, and register_argc_argv is enabled in php.ini (GHSA-jm6m-4632-36hf / CVE-2023-43655)
  • Fixed authentication issue when downloading several files from private Bitbucket in parallel (#11464)
  • Fixed handling of broken junctions on windows (#11550)
  • Fixed loading of root aliases on path repo packages when doing partial updates (#11632)
  • Fixed parsing of lib-curl-openssl version with OSX SecureTransport (#11534)
  • Fixed binary proxies not being transparent when included by another PHP process and returning a value (#11454)
  • Fixed support for plugin classes being marked as readonly (#11404)
  • Fixed GitHub rate limit reporting (#11366)
  • Fixed issue displaying solver problems with branch names containing % signs (#11359)
  • version 2.2.21 2023-02-15
  • Fixed extra.plugin-optional support in PluginInstaller when doing pre-install checks (#11326)
  • version 2.2.20 2023-02-10
  • Added extra.plugin-optional support for allow auto-disabling unknown plugins which are not critical when running non-interactive (#11315)
  • version 2.2.19 2023-02-04
  • Fixed URL sanitizer to handle new GitHub personal access tokens format (#11137)
  • Fixed cache keys to allow _ to avoid conflicts between package names like a-b and a_b (#11229)
  • Fixed handling of --ignore-platform-req with upper-bound ignores to not apply to conflict rules (#11037)
  • Fixed handling of COMPOSER_DISCARD_CHANGES when set to 0
  • version 2.2.18 2022-08-20
  • Fixed COMPOSER_NO_DEV so it also works with require and remove's --update-no-dev (#10995)
  • Fixed duplicate missing extension warnings being…
Record
SUSE-SU-2026:1970-1
Updated
2026-11-02
OSVUSN-7603-1 No score

composer vulnerabilities

Thomas Chauchefoin discovered that Composer did not correctly handle certain arguments. An attacker could possibly use this issue to execute arbitrary code. This issue only affected Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2022-24828, CVE-2023-43655)

Ed Cradock discovered that Composer did not correctly handle the exclusion of certain files. An attacker could possibly use this issue to execute arbitrary code. This issue only affected Ubuntu 22.04 LTS. (CVE-2024-24821)

Martin Haunschmid discovered that Composer did not correctly handle git branch names. An attacker could possibly use this issue to execute arbitrary code. (CVE-2024-35241)

Maciej Piechota discovered that Composer did not correctly handle VCS branch names. An attacker could possibly use this issue to execute arbitrary code. (CVE-2024-35242)

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

Affected products

Affected packages

Affected packages
PackageAffectedFixed
composer/composer
Packagist
before 1.10.26
1.10.26
composer/composer
Packagist
2.0 up to 2.2.12
2.2.12
composer/composer
Packagist
2.3 up to 2.3.5
2.3.5
composer
Alpine:v3.15
2.0.0 up to 2.2.12-r0
2.2.12-r0
composer
Alpine:v3.16
2.0.0 up to 2.3.5-r0
2.3.5-r0
composer
Alpine:v3.17
2.0.0 up to 2.3.5-r0
2.3.5-r0
composer
Alpine:v3.18
2.0.0 up to 2.3.5-r0
2.3.5-r0
composer
Alpine:v3.19
2.0.0 up to 2.3.5-r0
2.3.5-r0
composer
Alpine:v3.20
2.0.0 up to 2.3.5-r0
2.3.5-r0
composer
Alpine:v3.21
2.0.0 up to 2.3.5-r0
2.3.5-r0
Show 21 moreShow less
Affected packages
PackageAffectedFixed
composer
Alpine:v3.22
2.0.0 up to 2.3.5-r0
2.3.5-r0
composer
Alpine:v3.23
2.0.0 up to 2.3.5-r0
2.3.5-r0
composer
Alpine:v3.24
2.0.0 up to 2.3.5-r0
2.3.5-r0
composer
Bitnami
before 1.10.26, 2.0.0 up to 2.2.12, 2.3.0 up to 2.3.5
1.10.262.2.122.3.5
composer
Debian:12
before 2.2.12-1
2.2.12-1
composer
Debian:13
before 2.2.12-1
2.2.12-1
composer
Debian:14
before 2.2.12-1
2.2.12-1
composer/composer
Packagist
before 1.10.26, 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.221.10.231.10.241.10.251.10.31.10.41.10.51.10.61.10.71.10.81.10.91.2.0
1.10.26
composer/composer
Packagist
2.0 up to 2.2.12, plus listed versions
2.0.02.0.0-RC12.0.0-RC22.0.0-alpha12.0.0-alpha2
Show 43 moreShow less
2.0.0-alpha32.0.12.0.102.0.112.0.122.0.132.0.142.0.22.0.32.0.42.0.52.0.62.0.72.0.82.0.92.1.02.1.0-RC12.1.12.1.102.1.112.1.122.1.142.1.22.1.32.1.42.1.52.1.62.1.72.1.82.1.92.2.02.2.0-RC12.2.12.2.102.2.112.2.22.2.32.2.42.2.52.2.62.2.72.2.82.2.9
2.2.12
composer/composer
Packagist
2.3 up to 2.3.5, plus listed versions
2.3.02.3.0-RC12.3.0-RC22.3.12.3.22.3.32.3.4
2.3.5
php-composer2
SUSE:Linux Enterprise Module for Web and Scripting 15 SP4
before 2.2.3-150400.3.3.1
2.2.3-150400.3.3.1
php-composer2
openSUSE:Leap 15.4
before 2.2.3-150400.3.3.1
2.2.3-150400.3.3.1
composer
Ubuntu:Pro:16.04:LTS
before 1.0.0~beta2-1ubuntu0.1~esm2, 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-2
Show 4 moreShow less
1.0.0~alpha11-31.0.0~beta1-1ubuntu11.0.0~beta2-11.0.0~beta2-1ubuntu0.1~esm1
1.0.0~beta2-1ubuntu0.1~esm2
composer
Ubuntu:Pro:18.04:LTS
before 1.6.3-1ubuntu0.1~esm2, plus listed versions
1.5.1-11.5.2-11.6.2-11.6.3-11.6.3-1ubuntu0.1~esm1
1.6.3-1ubuntu0.1~esm2
composer
Ubuntu:Pro:20.04:LTS
before 1.10.1-1ubuntu0.1~esm2, plus listed versions
1.9.0-21.9.1-11.9.2-11.9.3-11.10.0-11.10.1-11.10.1-1ubuntu0.1~esm1
1.10.1-1ubuntu0.1~esm2
composer
Ubuntu:Pro:22.04:LTS
before 2.2.6-2ubuntu4+esm1, plus listed versions
2.0.9-2ubuntu22.0.9-2ubuntu32.0.13-1ubuntu12.1.12-1ubuntu12.2.6-2ubuntu4
2.2.6-2ubuntu4+esm1
composer
Ubuntu:Pro:24.04:LTS
before 2.7.1-2ubuntu0.1~esm1, plus listed versions
2.5.8-12.6.5-12.6.6-12.7.1-2
2.7.1-2ubuntu0.1~esm1
php-composer
SUSE:Package Hub 15 SP3
before 1.10.26-bp153.2.6.1
1.10.26-bp153.2.6.1
php-composer
openSUSE:Leap 15.3
before 1.10.26-bp153.2.6.1
1.10.26-bp153.2.6.1
php-composer2
openSUSE:Tumbleweed
before 2.3.5-1.1
2.3.5-1.1
php-composer
openSUSE:Tumbleweed
before 1.10.26-1.1
1.10.26-1.1

History

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

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

In short

CVE-2022-24828 is a high vulnerability (CVSS 8.3) in Composer, published April 13, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.89%, the 79th percentile. Fixed in composer/composer 1.10.26.

References

Show 32 moreShow less
This page doesn't list everything

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

MoveEnter Open