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

- Priority: **Routine**
- Reason: Not severe (CVSS 8.8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-06-10 · Modified: 2025-02-13
- Aliases: UBUNTU-CVE-2024-35242, DEBIAN-CVE-2024-35242, CGA-qwx8-f8j4-g4p6, CGA-x9p4-6mc7-h539, ALPINE-CVE-2024-35242
- Record: https://cvemate.com/vulnerability/CVE-2024-35242 · JSON: https://cvemate.com/vulnerability/CVE-2024-35242/json

## 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.
```

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- EPSS: 3.282%, percentile 88.84%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine composer (Alpine Linux): \< 2.7.7-r0
- chainguard composer (Chainguard): \< 2.7.7-r0
- wolfi composer (Wolfi): \< 2.7.7-r0
- composer composer: ≥ 2.0, \< 2.2.24 \| ≥ 2.3, \< 2.7.7
- debian composer (Debian): \< 2.5.5-1+deb12u2 \| \< 2.7.7-1
- ubuntu composer (Ubuntu): \< 1.0.0~beta2-1ubuntu0.1~esm2 \| \< 1.6.3-1ubuntu0.1~esm2 \| \< 1.10.1-1ubuntu0.1~esm2 \| \< 2.2.6-2ubuntu4+esm1 \| \< 2.7.1-2ubuntu0.1~esm1

## References

- <https://github.com/composer/composer/security/advisories/GHSA-v9qv-c7wm-wgmf>
- <https://github.com/composer/composer/commit/6bd43dff859c597c09bd03a7e7d6443822d0a396>
- <https://github.com/composer/composer/commit/fc57b93603d7d90b71ca8ec77b1c8a9171fdb467>
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VLPJHM2WWSYU2F6KHW2BYFGYL4IGTKHC/>
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PO4MU2BC7VR6LMHEX4X7DKGHVFXZV2MC/>
- <https://ubuntu.com/security/CVE-2024-35242>
- <https://www.cve.org/CVERecord?id=CVE-2024-35242>
- <https://ubuntu.com/security/notices/USN-7603-1>
- <https://security-tracker.debian.org/tracker/CVE-2024-35242>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35242.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2024-35242>
- <https://security.alpinelinux.org/vuln/CVE-2024-35242>

---

Data as of 2026-12-05T05:32:08.026Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
