Missing input validation can lead to command execution in composer
Description
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
composer/composerPackagist | < 1.10.26 | 1.10.26 |
composer/composerPackagist | >= 2.0, < 2.2.12 | 2.2.12 |
composer/composerPackagist | >= 2.3, < 2.3.5 | 2.3.5 |
Affected products
9- osv-coords8 versionspkg:bitnami/composerpkg:composer/composer/composerpkg:rpm/opensuse/php-composer2&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/php-composer2&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/php-composer&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/php-composer&distro=openSUSE%20Tumbleweedpkg:rpm/suse/php-composer2&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP4pkg:rpm/suse/php-composer&distro=SUSE%20Package%20Hub%2015%20SP3
< 1.10.26+ 7 more
- (no CPE)range: < 1.10.26
- (no CPE)range: < 1.10.26
- (no CPE)range: < 2.2.3-150400.3.3.1
- (no CPE)range: < 2.3.5-1.1
- (no CPE)range: < 1.10.26-bp153.2.6.1
- (no CPE)range: < 1.10.26-1.1
- (no CPE)range: < 2.2.3-150400.3.3.1
- (no CPE)range: < 1.10.26-bp153.2.6.1
Patches
Vulnerability mechanics
References
12- github.com/advisories/GHSA-x7cr-6qr6-2hh6ghsaADVISORY
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/625MT3IKWKFVIWLSYZFSXHVUA2LES7YQ/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GWT6LDSRY7SFMTDZWJ4MS2ZBXHL7VQEF/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QD7JQWL6C4GVROO25DTXWYWM6BPOPPCG/mitrevendor-advisoryx_refsource_FEDORA
- nvd.nist.gov/vuln/detail/CVE-2022-24828ghsaADVISORY
- github.com/FriendsOfPHP/security-advisories/blob/master/composer/composer/CVE-2022-24828.yamlghsaWEB
- github.com/composer/composer/commit/2c40c53637c5c7e43fff7c09d3d324d632734709ghsax_refsource_MISCWEB
- github.com/composer/composer/security/advisories/GHSA-x7cr-6qr6-2hh6ghsax_refsource_CONFIRMWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/625MT3IKWKFVIWLSYZFSXHVUA2LES7YQghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GWT6LDSRY7SFMTDZWJ4MS2ZBXHL7VQEFghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QD7JQWL6C4GVROO25DTXWYWM6BPOPPCGghsaWEB
- www.tenable.com/security/tns-2022-09ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.