Composer vulnerable to command injection via malicious git/hg branch names
CVE-2024-35242Published 10 Jun 2024, 21:23 UTC
Real-world risk
6.0/ 10Medium
Schedule in the normal cycle
PreliminaryFrom the CVSS vector only · confidence low
CVSS
8.8
scored by the vendor (CNA), CVSS 3.1
In plain words
No plain-language summary yet. The original description is below.
Original description (from GitHub_M)
Composer is a dependency manager for PHP. On the 2.x branch prior to versions 2.2.24 and 2.7.7, the `composer install` command running inside a git/hg repository which has specially crafted branch names can lead to command injection. This requires cloning untrusted repositories. Patches are available in version 2.2.24 for 2.2 LTS or 2.7.7 for mainline. As a workaround, avoid cloning potentially compromised repositories.
Am I affected?
What to do
Update to a fixed version: 2.2.24, 2.7.7.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | Full compromiseCode execution or full control of the system or application | From the CVSS vector | 1.00 |
| Attacker position | InternetAnyone on the Internet can reach a typical deployment | From the CVSS vector | 1.00 |
| Privileges needed | NoneNo account | From the CVSS vector | 1.00 |
| Victim interaction | RoutineA normal action: open a file, visit a page, click a link | From the CVSS vector | 0.70 |
| Configuration | DefaultOut-of-the-box installs are vulnerable | From the CVSS vector | 1.00 |
| Reliability | ReliableDeterministic: injection, logic bug, path traversal | From the CVSS vector | 1.00 |
Threat level T1: Nothing known (× 0.85)
The default for a new disclosure
EPSS 3.3% chance of exploitation in 30 days (percentile 89), as of 2026-12-03.
The arithmetic
- Prerequisites multiplied together0.700
- Threat T1: Nothing known0.850
- 10 × impact 1 × prerequisites 0.7 × threat 0.855.950
- Rounded to one decimal between 0.1 and 106.0
Exploitation and evidence timeline
- 10 Jun 2024 Published
- 3 Dec 2026 Risk 6.0 (cvss fallback)
Weakness
CWE-77
References
- https://github.com/composer/composer/security/advisories/GHSA-v9qv-c7wm-wgmfvendor-advisory, x-transferred
- https://github.com/composer/composer/commit/6bd43dff859c597c09bd03a7e7d6443822d0a396misc, x-transferred
- https://github.com/composer/composer/commit/fc57b93603d7d90b71ca8ec77b1c8a9171fdb467misc, x-transferred
- https://lists.fedoraproject.org/archives/list/[email protected]/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC/x-transferred
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC/x-transferred
- CVE-2024-35242 on CVE.org