# CVE-2024-35242: Composer vulnerable to command injection via malicious git/hg branch names

- Severity: High 8.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 3.28%, higher than 88% of CVEs (2026-12-01)
- Published: 2024-06-10T21:23:44.040Z
- Modified: 2026-09-10T03:50:15.857Z
- Also known as: GHSA-v9qv-c7wm-wgmf, BIT-COMPOSER-2024-35242
- Weaknesses: CWE-77
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- composer composer: >= 2.0, < 2.2.24; >= 2.3, < 2.7.7
- fedoraproject fedora: 39; 40
- getcomposer composer: from 2.0 before 2.2.24; from 2.3 before 2.7.7
- composer/composer (Packagist): from 2.0 before 2.2.24; from 2.3 before 2.7.7
- composer (Bitnami): from 2.0.0 before 2.2.24; from 2.3.0 before 2.7.7

## Every score

- GitHub_M: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/composer/composer/security/advisories/GHSA-v9qv-c7wm-wgmf> (web)
- <https://github.com/composer/composer/commit/6bd43dff859c597c09bd03a7e7d6443822d0a396> (web)
- <https://github.com/composer/composer/commit/fc57b93603d7d90b71ca8ec77b1c8a9171fdb467> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC/> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC/> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-35242> (advisory, web)
- <https://github.com/composer/composer> (package)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC> (web)

## Sources

- CVE List: [CVE-2024-35242](https://www.cve.org/CVERecord?id=CVE-2024-35242), CVE Terms of Use, modified 2025-02-13
- GitHub Advisory Database: [GHSA-v9qv-c7wm-wgmf](https://github.com/advisories/GHSA-v9qv-c7wm-wgmf), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-35242](https://nvd.nist.gov/vuln/detail/CVE-2024-35242), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-COMPOSER-2024-35242](https://osv.dev/vulnerability/BIT-COMPOSER-2024-35242), Apache-2.0, modified 2025-05-20

---

Page: https://cve.day/CVE-2024-35242 · Whole record: https://cve.day/CVE-2024-35242.json · Rebuilt by cve.day 2026-11-25T22:58:41.651Z
