CVE-2024-35241 — Vulnerability in composer/composer — CVE Details
Composer has a command injection via malicious git branch name
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.49%). Schedule for your next planned update.
Does your project use an affected composer/composer version?
Paste your composer.lock to check it for CVE-2024-35241 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Impact
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
2.2.24 for 2.2 LTS or 2.7.7 for mainline
Workarounds
Avoid installing dependencies via git by using --prefer-dist or the preferred-install: dist config setting.
Advisory Timeline
- First published June 10, 2024 (899 days ago).
- Last revised September 10, 2026 — 821 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
composer require "composer/composer:^2.7.7"
composer require "composer/composer:^2.2.24"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: Packagist (1).
| Package | Fixed In |
|---|---|
| composer/composer Packagist · Affected: 2.3.0, 2.3.0-RC1, 2.3.0-RC2, 2.3.1 (+38 more) | 2.7.7 |
| composer/composer Packagist · Affected: 2.0.0, 2.0.0-RC1, 2.0.0-RC2, 2.0.0-alpha1 (+56 more) | 2.2.24 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-77
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
References
- https://github.com/composer/composer/security/advisories/GHSA-47f6-5gq3-vx9cWEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-35241ADVISORY
- https://github.com/composer/composer/commit/b93fc6ca437da35ae73d667d0618749c763b67d4WEB
- https://github.com/composer/composer/commit/ee28354ca8d33c15949ad7de2ce6656ba3f68704WEB
- https://github.com/composer/composerPACKAGE
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MCWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHCWEB
- https://www.vicarius.io/vsociety/posts/cve-2024-35241-detect-composer-vulnerabilityWEB
- https://www.vicarius.io/vsociety/posts/cve-2024-35241-mitigate-vulnerable-composerWEB
Frequently Asked Questions
- What is CVE-2024-35241?
- Composer has a command injection via malicious git branch name. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
- How do I check if my project is affected by CVE-2024-35241?
- CVE-2024-35241 affects composer/composer. It has a 1.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-35241 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is an above-median EPSS score — 74.3% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-103035HIGH
TeamPass folder re-parenting authorization bypass
- CVE-2026-40261HIGH
Composer has a command injection via malicious perforce reference
- CVE-2026-110782HIGH
SAML2: Incomplete fix of CVE-2026-49283: unsigned embedded Response bypasses HTTP-Artifact signature verification (no embedded-Issuer binding)
- CVE-2026-84361HIGH
Composer arbitrary command execution via a malicious package's Perforce source URL
- CVE-2024-35242HIGH
Composer has multiple command injections via malicious git/hg branch names