CVE-2024-35241 json
Composer vulnerable to command injection via malicious git branch name
published 2024-06-10 2 y ago modified 2026-09-10 1 mo ago also BIT-composer-2024-35241 , EUVD-2024-1909 , GHSA-47f6-5gq3-vx9c
- cvss
- 8.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.1%
- EPSS 1.1% chance of exploitation in 30 days, percentile 64%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- packagist composer/composer 2.2.24, 2.7.7
- bitnami composer 2.2.24, 2.7.7
- getcomposer composer 2.2.24, 2.7.7
- composer Debian 12 2.5.5-1+deb12u2
- composer Debian 14, Debian 13 2.7.7-1
debian advisories DEBIAN-CVE-2024-35241
- composer Ubuntu Pro 16.04 LTS 1.0.0~beta2-1ubuntu0.1~esm2
- composer Ubuntu Pro 18.04 LTS 1.6.3-1ubuntu0.1~esm2
- composer Ubuntu Pro 20.04 LTS 1.10.1-1ubuntu0.1~esm2
- composer Ubuntu Pro 22.04 LTS 2.2.6-2ubuntu4+esm1
- composer Ubuntu Pro 24.04 LTS 2.7.1-2ubuntu0.1~esm1
ubuntu advisories UBUNTU-CVE-2024-35241
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- php-composer2 SLES for SAP 15 SP6, SLES 15 SP6-LTSS, SLE Module for Web and Scripting 15 SP7 2.6.4-150600.3.12.1
- php-composer2 SLE Module for Web and Scripting 15 SP6, openSUSE Leap 15.6 2.6.4-150600.3.3.1
- php-composer2 SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE Module for Web and Scripting 15 SP5 +4 more 2.2.3-150400.3.12.1
suse advisories SUSE-SU-2026:3105-1SUSE-SU-2024:2107-1SUSE-SU-2024:2106-1
- php-composer2 openSUSE Tumbleweed 2.7.7-1.1
opensuse advisories openSUSE-SU-2024:14040-1
- composer Alpine 3.24, Alpine 3.23, Alpine 3.22 +3 more 2.7.7-r0
alpine advisories ALPINE-CVE-2024-35241
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-35241 updated cvss 8.8
composer: crafted branch names in the repository can be used to execute code
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
1.05% chance of exploitation in the next 30 days, higher than 64% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| packagist | composer/composer | >=2.0, <2.2.24 >=2.3, <2.7.7 |
2.2.24 2.7.7 |
| bitnami | composer | >=2.0.0, <2.2.24 >=2.3.0, <2.7.7 |
2.2.24 2.7.7 |
Affected products
- composer composer
- fedoraproject fedora
- getcomposer composer
Classification
- Weakness
-
- CWE-77 Improper Neutralization of Special Elements used in a Command
References
-
github.com
/composer/composer/commit/b93fc6ca437da35ae73d667d0618749c763b67d4
web
-
github.com
/composer/composer/commit/ee28354ca8d33c15949ad7de2ce6656ba3f68704
web
-
github.com
/composer/composer/security/advisories/GHSA-47f6-5gq3-vx9c
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC/
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC/
web
-
vicarius.io
/vsociety/posts/cve-2024-35241-detect-composer-vulnerability
web
-
vicarius.io
/vsociety/posts/cve-2024-35241-mitigate-vulnerable-composer
web
-
nvd.nist.gov
/vuln/detail/CVE-2024-35241
advisory, web
-
github.com
/composer/composer
package
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC
web
Sources
- CVE List CVE-2024-35241
- GitHub Advisory GHSA-47f6-5gq3-vx9c
- NVD CVE-2024-35241
- OSV BIT-composer-2024-35241
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.