{"id":"CVE-2024-35241","published":"2024-06-10T21:19:47Z","modified":"2025-04-21T15:20:35Z","title":"Composer vulnerable to command injection via malicious git branch name","vendor":"composer","product":"composer","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0105,"percentile":0.65068,"provenance":"source"},"cwes":[{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command"}],"references":[{"url":"https://github.com/composer/composer/security/advisories/GHSA-47f6-5gq3-vx9c","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/composer/composer/commit/b93fc6ca437da35ae73d667d0618749c763b67d4","tags":["x_refsource_MISC"]},{"url":"https://github.com/composer/composer/commit/ee28354ca8d33c15949ad7de2ce6656ba3f68704","tags":["x_refsource_MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC/","tags":[]},{"url":"https://www.vicarius.io/vsociety/posts/cve-2024-35241-detect-composer-vulnerability","tags":[]},{"url":"https://www.vicarius.io/vsociety/posts/cve-2024-35241-mitigate-vulnerable-composer","tags":[]}],"priority":{"score":19.2,"factors":[{"name":"EPSS percentile","points":13.01},{"name":"CVSS severity","points":6.16}]},"vendorSlug":"composer","affectedVersions":[{"vendor":"composer","product":"composer","versions":[">= 2.0, < 2.2.24",">= 2.3, < 2.7.7"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2024-07-15T20:42:58.759423Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"composer/composer","vulnerableRanges":[">=2.0, <2.2.24",">=2.3, <2.7.7"],"patched":["2.2.24","2.7.7"],"from":["GHSA-47f6-5gq3-vx9c"],"provenance":"source"}],"summary":{"text":"Composer, the PHP dependency manager, contains a command injection flaw in its 2.x branch (prior to 2.2.24 and 2.7.7) that is triggered when packages installed from source via git have specially crafted branch names. An attacker who can get a repository with such a branch name into a project's dependencies can execute code when the status, reinstall or remove commands are run, typically requiring user interaction to run one of those commands.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:16:47Z"},"euvd":{"id":"EUVD-2024-1909","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2022-24828","published":"2022-04-13","fixed":"2.3.5","kev":false},{"cve":"CVE-2023-43655","published":"2023-09-29","fixed":"2.6.4","kev":false},{"cve":"CVE-2024-24821","published":"2024-02-08","fixed":"2.7.0","kev":false,"link":{"from":"CVE-2024-24821","to":"CVE-2024-35241","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:composer/composer","fromFixed":"2.2.23","toFixed":"2.2.24","daysApart":123}]}},{"cve":"CVE-2024-35241","published":"2024-06-10","fixed":"2.7.7","kev":false},{"cve":"CVE-2024-35242","published":"2024-06-10","fixed":"2.7.7","kev":false},{"cve":"CVE-2025-67746","published":"2025-12-30","fixed":"2.9.3","kev":false,"link":{"from":"CVE-2024-35241","to":"CVE-2025-67746","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:composer/composer","fromFixed":"2.2.24","toFixed":"2.2.26","daysApart":568}]}},{"cve":"CVE-2026-40176","published":"2026-04-15","fixed":"2.9.6","kev":false}],"package":"Packagist:composer/composer"}}