Home / composer / composer / CVE-2024-24821
CVE-2024-24821: is it exploited, and which versions of composer are affected and fixed?
CVE-2024-24821 is an inclusion of code from an untrusted source vulnerability in composer. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 18:39 UTC). Affected: composer/composer from 2.0.0-alpha1 before 2.2.23 and composer/composer from 2.3.0-rc1 before 2.7.0 (GitHub advisory GHSA-7c6p-848j-wh5h). Fixed in 2.2.23 and 2.7.0 (GitHub advisory GHSA-7c6p-848j-wh5h). Severity: High (8.8, CVSS 3.1, from GitHub_M).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 18:39 UTC, CVE record November 19, 2026, 07:11 UTC and NVD November 19, 2026, 07:32 UTC.
What is CVE-2024-24821?
Code execution and possible privilege escalation via compromised InstalledVersions.php or installed.php in Composer
Composer is a dependency Manager for the PHP language. In affected versions several files within the local working directory are included during the invocation of Composer and in the context of the executing user. As such, under certain conditions arbitrary code execution may lead to local privilege escalation, provide lateral user movement or malicious code execution when Composer is invoked within a directory with tampered files. All Composer CLI commands are affected, including composer.phar's self-update. The following scenarios are of high risk: Composer being run with sudo, Pipelines which may execute Composer on untrusted projects, Shared environments with developers who run Composer individually on the same project. This vulnerability has been addressed in versions 2.7.0 and 2.2.23. It is advised that the patched versions are applied at the earliest convenience. Where not possible, the following should be addressed: Remove all sudo composer privileges for all users to mitigate root privilege escalation, and avoid running Composer within an untrusted directory, or if needed, verify that the contents of `vendor/composer/InstalledVersions.php` and `vendor/composer/installed.php` do not include untrusted code. A reset can also be done on these files by the following:```sh rm vendor/composer/installed.php vendor/composer/InstalledVersions.php composer install --no-scripts --no-plugins ```
From the CVE record by GitHub_M, last updated June 17, 2025, 21:29 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| composer | composer | >= 2.0, < 2.2.23 >= 2.3, < 2.7 |
As the CVE record by GitHub_M states it, last updated June 17, 2025. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| Packagist | composer/composer | >= 2.0.0-alpha1, < 2.2.23 | 2.2.23 | GHSA-7c6p-848j-wh5h |
| Packagist | composer/composer | >= 2.3.0-rc1, < 2.7.0 | 2.7.0 | GHSA-7c6p-848j-wh5h |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated February 9, 2024. Summary: Composer code execution and possible privilege escalation via compromised InstalledVersions.php or installed.php.
Which products and versions does the NVD list as affected?
| Vendor | Product | Versions | Type |
|---|---|---|---|
| getcomposer | composer | from 2.0.0 before 2.2.23 | application |
| getcomposer | composer | from 2.3.0 before 2.7.0 | application |
NVD analysis (status Modified), last modified June 17, 2026, 07:14 UTC.
How severe is CVE-2024-24821?
| Score | Version | Vector | Source |
|---|---|---|---|
| High 8.8 | CVSS 3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H | GitHub_M |
| High 7.8 | CVSS 3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NVD |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2024-24821 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- CISA SSVC
- Exploitation: none; automatable: no; technical impact: total (CISA ADP, February 11, 2024)
- EPSS
- 0.28% probability of exploitation activity in the next 30 days, percentile 21.9 (FIRST EPSS, scores of December 3, 2026)
What kind of flaw is it?
- CWE-829 Inclusion of Functionality from Untrusted Control Sphere
Where are the vendor advisories and references?
- https://github.com/composer/composer/security/advisories/GHSA-7c6p-848j-wh5h x_refsource_CONFIRM
- https://github.com/composer/composer/commit/64e4eb356b159a30c766cd1ea83450a38dc23bf5 x_refsource_MISC
When was it published, and where is the official record?
- Reserved
- January 31, 2024
- Published
- February 8, 2024, 23:54 UTC
- CVE record updated
- June 17, 2025, 21:29 UTC by GitHub_M
- NVD
- Modified, last modified June 17, 2026, 07:14 UTC
- Last checked
- CVE list November 19, 2026, 07:11 UTC; NVD November 19, 2026, 07:32 UTC; KEV December 3, 2026, 18:39 UTC; EPSS December 3, 2026
- Official record
- cve.org · NVD
What other CVEs affect composer?
- Sep 16, 2026CVE-2026-59944 composer: path traversal (reading or writing files outside the intended folder)
- Sep 1, 2026CVE-2026-84361 composer: OS command injection
- Jul 15, 2026CVE-2026-45793 composer: information disclosure
- Jul 8, 2026CVE-2026-59947 composer: sensitive information written to log files
- Jul 8, 2026CVE-2026-59948 composer: path traversal (reading or writing files outside the intended folder)
- Jul 8, 2026CVE-2026-59946 composer: path traversal (reading or writing files outside the intended folder)
- Apr 15, 2026CVE-2026-40261 composer: OS command injection
- Apr 15, 2026CVE-2026-40176 composer: improper input validation
Questions about CVE-2024-24821
Is CVE-2024-24821 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 18:39 UTC. FIRST's EPSS gives it a 0.28% chance of exploitation activity in the next 30 days (scores of December 3, 2026).
Which versions of composer are affected by CVE-2024-24821?
composer/composer from 2.0.0-alpha1 before 2.2.23 and composer/composer from 2.3.0-rc1 before 2.7.0, per the GitHub advisory GHSA-7c6p-848j-wh5h. The tables above give every range the sources list.
Which version fixes CVE-2024-24821?
2.2.23 and 2.7.0, per the GitHub advisory GHSA-7c6p-848j-wh5h. Check the vendor's advisory before you rely on it.
How severe is CVE-2024-24821?
High (8.8, CVSS 3.1, from GitHub_M). The severity table above shows each score with its source.
Where is the official record of CVE-2024-24821?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.