{"id":"CVE-2024-35242","published":"2024-06-10T21:23:44Z","modified":"2025-02-13T17:52:34Z","title":"Composer vulnerable to command injection via malicious git/hg branch names","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 `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.","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.04588,"percentile":0.92406,"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-v9qv-c7wm-wgmf","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/composer/composer/commit/6bd43dff859c597c09bd03a7e7d6443822d0a396","tags":["x_refsource_MISC"]},{"url":"https://github.com/composer/composer/commit/fc57b93603d7d90b71ca8ec77b1c8a9171fdb467","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":[]}],"priority":{"score":29.6,"factors":[{"name":"EPSS percentile","points":18.48},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":6.16}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2024-07-15","earliestUrl":"https://github.com/KKkai0315/CVE-2024-35242","repos":[{"name":"KKkai0315/CVE-2024-35242","url":"https://github.com/KKkai0315/CVE-2024-35242","stars":0,"created":"2024-07-15"}]},"first":{"date":"2024-07-15","source":"PoC-in-GitHub","url":"https://github.com/KKkai0315/CVE-2024-35242"},"provenance":"source"},"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:44:05.596723Z","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-v9qv-c7wm-wgmf"],"provenance":"source"}],"summary":{"text":"The flaw is a command injection weakness in Composer, the PHP dependency manager, on the 2.x branch before 2.2.24 and 2.7.7, where branch names in a git or hg repository can be crafted to inject commands when composer install runs. An attacker can achieve this by supplying a specially crafted branch name in a repository that a victim clones, which requires the victim to clone and install from untrusted repositories and does not require authentication or network access beyond that.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T04:03:45Z"},"euvd":{"id":"EUVD-2024-2177","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"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-35242","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},{"cve":"CVE-2026-40176","published":"2026-04-15","fixed":"2.9.6","kev":false},{"cve":"CVE-2026-40261","published":"2026-04-15","fixed":"2.9.6","kev":false}],"package":"Packagist:composer/composer"}}