Skip to content
Fencer Vulns
high 8.8

CVE-2024-24821 json

Code execution and possible privilege escalation via compromised InstalledVersions.php or installed.php in Composer

published 2024-02-08 2 y ago modified 2026-09-10 1 mo ago also BIT-composer-2024-24821 , EUVD-2024-0553 , GHSA-7c6p-848j-wh5h

cvss
8.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.3%
EPSS 0.3% chance of exploitation in 30 days, percentile 20%
public exploits
0
none known

Summary

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

Patch / fix

  • packagist composer/composer 2.2.23, 2.7.0
  • bitnami composer 2.2.23, 2.7.0
  • getcomposer composer 2.2.23, 2.7.0
  • composer Debian 12 2.5.5-1+deb12u1
  • composer Debian 14, Debian 13 2.7.1-1

debian advisories DEBIAN-CVE-2024-24821

  • composer Ubuntu Pro 22.04 LTS 2.2.6-2ubuntu4+esm1

ubuntu advisories UBUNTU-CVE-2024-24821

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • php-composer2 SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE Module for Web and Scripting 15 SP5 +4 more 2.2.3-150400.3.9.1

suse advisories SUSE-SU-2024:0592-1

  • php-composer2 openSUSE Tumbleweed 2.7.1-1.1

opensuse advisories openSUSE-SU-2024:13681-1

  • composer Alpine 3.24, Alpine 3.23, Alpine 3.22 +3 more 2.7.0-r0

alpine advisories ALPINE-CVE-2024-24821

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
total
Assessed
2 y ago

Exploit prediction

0.28% chance of exploitation in the next 30 days, higher than 20% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 8.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
GitHub 3.1 8.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
NVD 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
OSV 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
packagist composer/composer
>=2.0.0-alpha1, <2.2.23
>=2.3.0-rc1, <2.7.0
2.2.23
2.7.0
bitnami composer
>=2.0.0, <2.2.23
>=2.3.0, <2.7.0
2.2.23
2.7.0

Affected products

  • composer composer

Classification

Weakness
  • CWE-829 Inclusion of Functionality from Untrusted Control Sphere

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.