# CVE-2024-24821: Code execution and possible privilege escalation via compromised InstalledVersions.php or installed.php in Composer

- Severity: High 8.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.28%, higher than 21% of CVEs (2026-12-01)
- Published: 2024-02-08T15:06:38.000Z
- Modified: 2026-09-10T03:50:09.776Z
- Also known as: GHSA-7c6p-848j-wh5h, BIT-COMPOSER-2024-24821
- Weaknesses: CWE-829
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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
```

(As written by CVE List.)

## Affected

- composer composer: >= 2.0, < 2.2.23; >= 2.3, < 2.7
- composer/composer (Packagist): from 2.0.0-alpha1 before 2.2.23; from 2.3.0-rc1 before 2.7.0
- getcomposer composer: from 2.0.0 before 2.2.23; from 2.3.0 before 2.7.0
- composer (Bitnami): from 2.0.0 before 2.2.23; from 2.3.0 before 2.7.0

## Every score

- GitHub_M: CVSS:3.1 8.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- GitHub: CVSS:3.1 8.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/composer/composer/security/advisories/GHSA-7c6p-848j-wh5h> (advisory, third-party-advisory, web)
- <https://github.com/composer/composer/commit/64e4eb356b159a30c766cd1ea83450a38dc23bf5> (fix, patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-24821> (advisory, web)
- <https://github.com/composer/composer/commit/77e3982918bc1d886843dc3d5e575e7e871b27b7> (web)
- <https://github.com/composer/composer> (package)

## Sources

- CVE List: [CVE-2024-24821](https://www.cve.org/CVERecord?id=CVE-2024-24821), CVE Terms of Use, modified 2025-06-17
- GitHub Advisory Database: [GHSA-7c6p-848j-wh5h](https://github.com/advisories/GHSA-7c6p-848j-wh5h), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-24821](https://nvd.nist.gov/vuln/detail/CVE-2024-24821), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-COMPOSER-2024-24821](https://osv.dev/vulnerability/BIT-COMPOSER-2024-24821), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2024-24821 · Whole record: https://cve.day/CVE-2024-24821.json · Rebuilt by cve.day 2026-11-25T22:58:36.681Z
