cve.bz

CVE-2024-24821 getcomposer composer

7.8 highEPSS 0.3%Fix available

High (7.8) in getcomposer composer. EPSS 0.3% estimated probability of exploitation activity in the next 30 days. Fixed in composer/composer 2.2.23, 2.7.0.

On this page
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 ```

Severity

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
EPSS
0.3% (unchanged from 0.3% a week ago; 0.3% 30 days ago) estimated probability of exploitation activity in the next 30 days; 21st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2024-02-11. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-829 Inclusion of Functionality from Untrusted Control Sphere
OWASP Top 10
A08:2025 Software or Data Integrity Failures
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-24821 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-24821?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-24821?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-24821 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
getcomposer:composerfrom 2.0.0 before 2.2.23
getcomposer:composerfrom 2.3.0 before 2.7.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-7c6p-848j-wh5hPackagistcomposer/composer>=2.0.0-alpha1 <2.2.232.2.23
GHSA-7c6p-848j-wh5hPackagistcomposer/composer>=2.3.0-rc1 <2.7.02.7.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11composer2.0.9-2+deb11u2DSA-5632-1
Debian12composer2.5.5-1+deb12u1DEBIAN-CVE-2024-24821 DSA-5632-1
Debian13, 14composer2.7.1-1DEBIAN-CVE-2024-24821
UbuntuPro:16.04:LTScomposer1.0.0~beta2-1ubuntu0.1~esm2USN-7603-1
UbuntuPro:18.04:LTScomposer1.6.3-1ubuntu0.1~esm2USN-7603-1
UbuntuPro:20.04:LTScomposer1.10.1-1ubuntu0.1~esm2USN-7603-1
UbuntuPro:22.04:LTScomposer2.2.6-2ubuntu4+esm1UBUNTU-CVE-2024-24821 USN-7603-1
UbuntuPro:24.04:LTScomposer2.7.1-2ubuntu0.1~esm1USN-7603-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise Module for Web and Scripting 15 SP5 and 3 morephp-composer22.2.3-150400.3.9.1SUSE-SU-2024:0592-1
openSUSELeap 15.5php-composer22.2.3-150400.3.9.1SUSE-SU-2024:0592-1
openSUSETumbleweedphp-composer22.7.1-1.1openSUSE-SU-2024:13681-1
Alpinev3.19, v3.20, v3.21 and 3 morecomposer2.7.0-r0ALPINE-CVE-2024-24821

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpine.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-829 (13).

References

Check your stackJSON