CVE-2024-35241
published high CVSS 3.1 · 8.8Composer vulnerable to command injection via malicious git branch name
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-650 | 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-650 |
| 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-650 |
Description
Composer is a dependency manager for PHP. On the 2.x branch prior to versions 2.2.24 and 2.7.7, the `status`, `reinstall` and `remove` commands with packages installed from source via git containing specially crafted branch names in the repository can be used to execute code. Patches for this issue are available in version 2.2.24 for 2.2 LTS or 2.7.7 for mainline. As a workaround, avoid installing dependencies via git by using `--prefer-dist` or the `preferred-install: dist` config setting.
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
7- https://github.com/composer/composer/commit/b93fc6ca437da35ae73d667d0618749c763b67d4
- https://github.com/composer/composer/commit/ee28354ca8d33c15949ad7de2ce6656ba3f68704
- https://github.com/composer/composer/security/advisories/GHSA-47f6-5gq3-vx9c
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC/
- https://www.vicarius.io/vsociety/posts/cve-2024-35241-detect-composer-vulnerability
- https://www.vicarius.io/vsociety/posts/cve-2024-35241-mitigate-vulnerable-composer
Provider assertions
3GitHub_M · cna
Composer vulnerable to command injection via malicious git branch name
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- cd329ca2906083e2f05e64f89397e25c60334e7a31584ae560d9ef6653d0a7e9
- Ingested
- 23 Sep 2026, 08:23:37 UTC
- Source record
- Official CVE record