High severity · published Jun 10, 2024
CVE-2024-35242
Composer vulnerable to command injection via malicious git/hg branch names
8.8
CVSS
3.3%
EPSS
No
On KEV
Description
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.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)3.3% · higher than 88% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
CO
composer · composer
>= 2.0, < 2.2.24; >= 2.3, < 2.7.7 · source: vendor, CISA
FE
Fedora · Fedoraproject
39; 40 · source: CISA
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2024-35242
CVE.org
https://www.cve.org/CVERecord?id=CVE-2024-35242
github.com
https://github.com/composer/composer/commit/6bd43dff859c597c09bd03a7e7d6443822d0a396
github.com
https://github.com/composer/composer/commit/fc57b93603d7d90b71ca8ec77b1c8a9171fdb467
github.com
https://github.com/composer/composer/security/advisories/GHSA-v9qv-c7wm-wgmf
lists.fedoraproject.org
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC/
lists.fedoraproject.org
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC/
More from composer
8.8
CVE-2026-40261
Composer has Command Injection via Malicious Perforce Reference
8.8
CVE-2024-35241
Composer vulnerable to command injection via malicious git branch name
7.8
CVE-2026-40176
Composer is vulnerable to Command Injection via Malicious Perforce Repository
7.7
CVE-2026-84361
Composer: Perforce source URL permits P4PORT `rsh:` command execution
7.5
CVE-2026-45793
Composer: Github Actions issued GITHUB_TOKEN disclosure in GitHub Actions logs
