CVE-2022-24828
Missing input validation can lead to command execution in composer
Reported by github_m · Published April 13, 2022
composer/composer is fixed in 2.3.5, 2.2.12 and 1.10.26 (Packagist)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| composer/composer | Packagist | 2.3.5, 2.2.12, 1.10.26 |
| composer | Bitnami | 2.3.5, 2.2.12, 1.10.26 |
| tenable.sc | tenable | 5.21.0 |
| composer | getcomposer | 2.3.5, 2.2.12, 1.10.26 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| composer | composer | < 1.10.26, >= 2.0.0, < 2.2.12, >= 2.3, < 2.3.6 |
| composer | composer | 2.3.0, 2.0, 0 |
| composer | composer | 2.3, 0, 2.0.0 |
| alpine | composer | 0, 0 |
Timeline
- Apr 13, 2022 CVE Published
- Apr 14, 2022 EPSS Score (30 in total, the first dated here)
- Apr 22, 2022 CVE Updated
- Mar 17, 2026 Security Advisory (2 in total, the first dated here)
- Jul 2, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-24828
vulnetix vdb fixes CVE-2022-24828
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-24828/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_CONFIRM
- x_refsource_MISC
- x_refsource_CONFIRM
- FEDORA-2022-617a6df23e vendor-advisoryx_refsource_FEDORA
- FEDORA-2022-47d2e7da46 vendor-advisoryx_refsource_FEDORA
- FEDORA-2022-60ec715192 vendor-advisoryx_refsource_FEDORA
- https://nvd.nist.gov/vuln/detail/CVE-2022-24828 advisory
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GWT6LDSRY7SFMTDZWJ4MS2ZBXHL7VQEF/ url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QD7JQWL6C4GVROO25DTXWYWM6BPOPPCG/ url
- https://github.com/advisories/GHSA-x7cr-6qr6-2hh6 advisory