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

- Priority: **Routine**
- Reason: Not severe (CVSS 8.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-02-08 · Modified: 2025-06-17
- Aliases: SUSE-SU-2024:0592-1, UBUNTU-CVE-2024-24821, DEBIAN-CVE-2024-24821, DSA-5632-1, openSUSE-SU-2024:13681-1, ALPINE-CVE-2024-24821
- Record: https://cvemate.com/vulnerability/CVE-2024-24821 · JSON: https://cvemate.com/vulnerability/CVE-2024-24821/json

## Description

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

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- EPSS: 0.279%, percentile 21.82%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine composer (Alpine Linux): ≥ 2.0.0, \< 2.7.0-r0 \| ≥ 2.3.0, \< 2.7.0-r0
- composer composer: ≥ 2.0, \< 2.2.23 \| ≥ 2.3, \< 2.7
- debian composer (Debian): \< 2.7.1-1 \| \< 2.0.9-2+deb11u2 \| \< 2.5.5-1+deb12u1
- ubuntu composer (Ubuntu): \< 2.2.6-2ubuntu4+esm1
- getcomposer composer: ≥ 2.0.0, \< 2.2.23 \| ≥ 2.3.0, \< 2.7.0
- opensuse php-composer2&distro=openSUSE Leap 15.5 (openSUSE): \< 2.2.3-150400.3.9.1
- opensuse php-composer2&distro=openSUSE Tumbleweed (openSUSE): \< 2.7.1-1.1
- suse php-composer2&distro=SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS (SUSE Linux Enterprise): \< 2.2.3-150400.3.9.1
- suse php-composer2&distro=SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS (SUSE Linux Enterprise): \< 2.2.3-150400.3.9.1
- suse php-composer2&distro=SUSE Linux Enterprise Module for Web and Scripting 15 SP5 (SUSE Linux Enterprise): \< 2.2.3-150400.3.9.1
- suse php-composer2&distro=SUSE Linux Enterprise Server 15 SP4-LTSS (SUSE Linux Enterprise): \< 2.2.3-150400.3.9.1
- suse php-composer2&distro=SUSE Linux Enterprise Server for SAP Applications 15 SP4 (SUSE Linux Enterprise): \< 2.2.3-150400.3.9.1
- suse php-composer2&distro=SUSE Manager Server 4.3 (SUSE Linux Enterprise): \< 2.2.3-150400.3.9.1

## References

- <https://github.com/composer/composer/security/advisories/GHSA-7c6p-848j-wh5h>
- <https://github.com/composer/composer/commit/64e4eb356b159a30c766cd1ea83450a38dc23bf5>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240592-1/>
- <https://bugzilla.suse.com/1219757>
- <https://www.suse.com/security/cve/CVE-2024-24821>
- <https://ubuntu.com/security/CVE-2024-24821>
- <https://www.cve.org/CVERecord?id=CVE-2024-24821>
- <https://ubuntu.com/security/notices/USN-7603-1>
- <https://security-tracker.debian.org/tracker/CVE-2024-24821>
- <https://security.alpinelinux.org/vuln/CVE-2024-24821>

---

Data as of 2026-12-05T06:19:07.652Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
