Vulnerability · Published Apr 13, 2022 · Assigned by GitHub_M
CVE-2022-24828Missing input validation can lead to command execution in composer
High 8.3
In plain English
A high-severity improper input validation in composer from composer. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.9% (higher than 80% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | composer | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine:v3.21 | composer | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine:v3.22 | composer | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine:v3.23 | composer | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine:v3.24 | composer | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Debian:12 | composer | 2.2.12-1 | DEBIAN-CVE-2022-24828 |
| Debian:13 | composer | 2.2.12-1 | DEBIAN-CVE-2022-24828 |
| Debian:14 | composer | 2.2.12-1 | DEBIAN-CVE-2022-24828 |
| Packagist | composer/composer | 2.3.5 | GHSA-x7cr-6qr6-2hh6 |
| Packagist | composer/composer | 2.2.12 | GHSA-x7cr-6qr6-2hh6 |
| Packagist | composer/composer | 1.10.26 | GHSA-x7cr-6qr6-2hh6 |
Affected products (as reported)
Weakness: CWE-20 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
References
- https://github.com/composer/composer/security/advisories/GHSA-x7cr-6qr6-2hh6 x_refsource_CONFIRM
- https://github.com/composer/composer/commit/2c40c53637c5c7e43fff7c09d3d324d632734709 x_refsource_MISC
- https://www.tenable.com/security/tns-2022-09 x_refsource_CONFIRM
- FEDORA-2022-617a6df23e vendor-advisory, x_refsource_FEDORA
- FEDORA-2022-47d2e7da46 vendor-advisory, x_refsource_FEDORA
- FEDORA-2022-60ec715192 vendor-advisory, x_refsource_FEDORA