CVE-2024-35242
published high CVSS 3.1 · 8.8Composer vulnerable to command injection via malicious git/hg branch names
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| composer | — | composer>= 2.0, < 2.2.24 · >= 2.3, < 2.7.7 | Affected | Not stated | GitHub_M |
| fedoraproject | — | fedora39 · 40 · Other versions: unknown | Affected | Not stated | CISA-ADP |
| getcomposer | — | composer2.0 to < 2.2.24 · Other versions: unknown | Affected | Not stated | CISA-ADP |
| getcomposer | — | composer2.3 to < 2.7.7 · Other versions: unknown | Affected | Not stated | CISA-ADP |
| Amazon Linux | AL2023 | Release evaluationALAS2023-2024-659 | Fixed | Not stated | Amazon Linux assessment |
| Alpine Linux | edge | composer | Fixed | 2.7.7-r0 | Package fix record |
| Debian | bookworm | composer | Advisory build | 2.5.5-1+deb12u2 | DSA-5715-1 |
| Ubuntu | bionic | composer | Advisory build | 1.6.3-1ubuntu0.1~esm2 | USN-7603-1 |
Show 27 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | SLE-15-SP4 | php-composer2noarch | Advisory build | 2.2.27-150400.3.18.1 | SUSE-SU-2026:1970-1 |
| Amazon Linux | AL2023 | composernoarch | Listed in advisory | Not stated | ALAS2023-2024-659 |
| Alpine Linux | v3.19 | composer | Fixed | 2.7.7-r0 | Package fix record |
| Alpine Linux | v3.20 | composer | Fixed | 2.7.7-r0 | Package fix record |
| Alpine Linux | v3.21 | composer | Fixed | 2.7.7-r0 | Package fix record |
| Alpine Linux | v3.22 | composer | Fixed | 2.7.7-r0 | Package fix record |
| Alpine Linux | v3.23 | composer | Fixed | 2.7.7-r0 | Package fix record |
| Alpine Linux | v3.24 | composer | Fixed | 2.7.7-r0 | Package fix record |
| Debian | bullseye | composer | Advisory build | 2.0.9-2+deb11u3 | DSA-5715-1 |
| Debian | buster | composer | Advisory build | 1.8.4-1+deb10u4 | DLA-3838-1 |
| Ubuntu | focal | composer | Advisory build | 1.10.1-1ubuntu0.1~esm2 | USN-7603-1 |
| Ubuntu | jammy | composer | Advisory build | 2.2.6-2ubuntu4+esm1 | USN-7603-1 |
| Ubuntu | noble | composer | Advisory build | 2.7.1-2ubuntu0.1~esm1 | USN-7603-1 |
| Ubuntu | xenial | composer | Advisory build | 1.0.0~beta2-1ubuntu0.1~esm2 | USN-7603-1 |
| SUSE / openSUSE | SLE-15-SP4 | php-composer2noarch | Advisory build | 2.2.3-150400.3.12.1 | SUSE-SU-2024:2106-1 |
| SUSE / openSUSE | SLE-15-SP5 | php-composer2noarch | Advisory build | 2.2.27-150400.3.18.1 | SUSE-SU-2026:1970-1 |
| SUSE / openSUSE | SLE-15-SP5 | php-composer2noarch | Advisory build | 2.2.3-150400.3.12.1 | SUSE-SU-2024:2106-1 |
| SUSE / openSUSE | SLE-15-SP6 | php-composer2noarch | Advisory build | 2.6.4-150600.3.12.1 | SUSE-SU-2026:3105-1 |
| SUSE / openSUSE | SLE-15-SP6 | php-composer2noarch | Advisory build | 2.6.4-150600.3.3.1 | SUSE-SU-2024:2107-1 |
| SUSE / openSUSE | SLE-15-SP7 | php-composer2noarch | Advisory build | 2.6.4-150600.3.12.1 | SUSE-SU-2026:3105-1 |
| SUSE / openSUSE | openSUSE-Leap-15.5 | php-composer2noarch | Advisory build | 2.2.3-150400.3.12.1 | SUSE-SU-2024:2106-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | php-composer2noarch | Advisory build | 2.6.4-150600.3.3.1 | SUSE-SU-2024:2107-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | php-composer2aarch64 | Advisory build | 2.7.7-1.1 | OPENSUSE-SU-2024:14040-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | php-composer2ppc64le | Advisory build | 2.7.7-1.1 | OPENSUSE-SU-2024:14040-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | php-composer2s390x | Advisory build | 2.7.7-1.1 | OPENSUSE-SU-2024:14040-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | php-composer2x86_64 | Advisory build | 2.7.7-1.1 | OPENSUSE-SU-2024:14040-1 |
| Amazon Linux | AL2023 | composersrc | Listed in advisory | Not stated | ALAS2023-2024-659 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 8.8 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| composer | composer | >= 2.0, < 2.2.24 (affected)>= 2.3, < 2.7.7 (affected) | GitHub_M · cna |
| fedoraproject | fedora | 39 (affected)40 (affected)Default: unknown | CISA-ADP · adp |
| getcomposer | composer | 2.0 to < 2.2.24 (affected · custom)Default: unknown | CISA-ADP · adp |
| getcomposer | composer | 2.3 to < 2.7.7 (affected · custom)Default: unknown | CISA-ADP · adp |
Weaknesses
1- CWE-77 CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
References
5- https://github.com/composer/composer/commit/6bd43dff859c597c09bd03a7e7d6443822d0a396
- https://github.com/composer/composer/commit/fc57b93603d7d90b71ca8ec77b1c8a9171fdb467
- https://github.com/composer/composer/security/advisories/GHSA-v9qv-c7wm-wgmf
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC/
Provider assertions
3GitHub_M · cna
Composer vulnerable to command injection via malicious git/hg branch names
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 01e20578b2fce6ffaed1d3ba2b000b66173ae33f252d38dfa875196575a29959
- Ingested
- 23 Sep 2026, 08:23:37 UTC
- Source record
- Official CVE record