CVE-2022-24828Missing 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.
What to do
Fixed builds are available from Alpine, Debian, Packagist: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | composer | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | composer | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | composer | Fix pending | 2.2.6-2ubuntu4+esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-24828 |
| Ubuntu 20.04 | composer | Fix pending | 1.10.1-1ubuntu0.1~esm2 (Ubuntu Pro) | UBUNTU-CVE-2022-24828 |
| Ubuntu 18.04 | composer | Fix pending | 1.6.3-1ubuntu0.1~esm2 (Ubuntu Pro) | UBUNTU-CVE-2022-24828 |
| Ubuntu 16.04 | composer | Fix pending | 1.0.0~beta2-1ubuntu0.1~esm2 (Ubuntu Pro) | UBUNTU-CVE-2022-24828 |
| Debian 14 | composer | Fixed | 2.2.12-1 | DEBIAN-CVE-2022-24828 |
| Debian 13 | composer | Fixed | 2.2.12-1 | DEBIAN-CVE-2022-24828 |
| Debian 12 | composer | Fixed | 2.2.12-1 | DEBIAN-CVE-2022-24828 |
| Alpine Linux 3.24 | composer | Fixed | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine Linux 3.23 | composer | Fixed | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine Linux 3.22 | composer | Fixed | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine Linux 3.21 | composer | Fixed | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine Linux 3.20 | composer | Fixed | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine Linux 3.19 | composer | Fixed | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine Linux 3.18 | composer | Fixed | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine Linux 3.17 | composer | Fixed | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine Linux 3.16 | composer | Fixed | 2.3.5-r0 | ALPINE-CVE-2022-24828 |
| Alpine Linux 3.15 | composer | Fixed | 2.2.12-r0 | ALPINE-CVE-2022-24828 |
| Packagist library | composer/composer | Fixed | 2.2.12 | GHSA-x7cr-6qr6-2hh6 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- composer: affected: < 1.10.26, >= 2.0.0, < 2.2.12, >= 2.3, < 2.3.6
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://github.com/composer/composer/security/advisories/GHSA-x7cr-6qr6-2hh6
- https://github.com/composer/composer/commit/2c40c53637c5c7e43fff7c09d3d324d632734709
- https://www.tenable.com/security/tns-2022-09
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QD7JQWL6C4GVROO25DTXWYWM6BPOPPCG/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GWT6LDSRY7SFMTDZWJ4MS2ZBXHL7VQEF/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/625MT3IKWKFVIWLSYZFSXHVUA2LES7YQ/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.