CVE-2024-24821
CVE-2024-24821 is a high-severity vulnerability in Getcomposer Composer with a CVSS 3.x base score of 8.8. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-829.
Key facts
- Severity: High (CVSS 3.x base score 8.8)
- EPSS exploit prediction: 0% (19th percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2024-0553
- Weakness: CWE-829
- Affected product: Getcomposer Composer
- Published:
- Last modified:
Description
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 ```
Frequently asked questions
- What is CVE-2024-24821?
- 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 ```
- How severe is CVE-2024-24821?
- CVE-2024-24821 has a CVSS 3.x base score of 8.8, rated high severity. It is exploitable over local access with low attack complexity, requires low privileges and no user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2024-24821 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 0% (19th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2024-24821?
- CVE-2024-24821 affects Getcomposer Composer. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2024-24821?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
- Does CVE-2024-24821 have an EU (EUVD) identifier?
- Yes. CVE-2024-24821 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2024-0553.
- When was CVE-2024-24821 published?
- CVE-2024-24821 was published on 2024-02-09 and last updated on 2026-06-17.
References
- https://github.com/composer/composer/commit/64e4eb356b159a30c766cd1ea83450a38dc23bf5
- https://github.com/composer/composer/security/advisories/GHSA-7c6p-848j-wh5h
Affected products (1)
- cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:*
More vulnerabilities in Getcomposer Composer
- CVE-2026-40261 — High (CVSS 8.8): Composer is a dependency manager for PHP. Versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection…
- CVE-2015-8371 — High (CVSS 8.8): Composer before 2016-02-10 allows cache poisoning from other projects built on the same host. This results in…
- CVE-2021-29472 — High (CVSS 8.8): Composer is a dependency manager for PHP. URLs for Mercurial repositories in the root composer.json and package source…
- CVE-2022-24828 — High (CVSS 8.3): Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call…
- CVE-2021-41116 — High (CVSS 8.2): Composer is an open source dependency manager for the PHP language. In affected versions windows users running Composer…
- CVE-2026-40176 — High (CVSS 7.8): Composer is a dependency manager for PHP. Versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection…
All CVEs affecting Getcomposer Composer →
Other CWE-829 vulnerabilities
- CVE-2026-1699 — Critical (CVSS 10.0): In the Eclipse Theia Website repository, the GitHub Actions workflow .github/workflows/preview.yml used…
- CVE-2025-70974 — Critical (CVSS 10.0): Fastjson before 1.2.48 mishandles autoType because, when an @type key is in a JSON document, and the value of that key…
- CVE-2025-0982 — Critical (CVSS 10.0): Sandbox escape in the JavaScript Task feature of Google Cloud Application Integration allows an actor to execute…
- CVE-2021-41037 — Critical (CVSS 10.0): In Eclipse p2, installable units are able to alter the Eclipse Platform installation and the local machine via…
- CVE-2022-1161 — Critical (CVSS 10.0): An attacker with the ability to modify a user program may change user program code on some ControlLogix, CompactLogix,…
- CVE-2020-4561 — Critical (CVSS 10.0): IBM Cognos Analytics 11.0 and 11.1 DQM API allows submitting of all control requests in unauthenticated sessions. This…