8.8high
Composer vulnerable to command injection via malicious git branch name
- Severity
- 8.8high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.49% (higher than 74% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-47f6-5gq3-vx9cBIT-COMPOSER-2024-35241
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| composer composer | >= 2.0, < 2.2.24, >= 2.3, < 2.7.7 | CVE List |
| fedoraproject fedora | 39, 40 | CVE List |
| getcomposer composer | from 2.0 before 2.2.24, from 2.3 before 2.7.7 | CVE List |
| composer/composer (Packagist) | from 2.0 before 2.2.24, from 2.3 before 2.7.7 | GitHub Advisory Database |
| composer (Bitnami) | from 2.0.0 before 2.2.24, from 2.3.0 before 2.7.7 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| Bitnami Vulnerability Database | high rating |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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.
GitHub Advisory Database
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.
NVD (es)
Composer es un administrador de dependencias para PHP. En la rama 2.x anterior a las versiones 2.2.24 y 2.7.7, los comandos `status`, `reinstall` y `remove` con paquetes instalados desde el código fuente a través de git que contienen nombres de ramas especialmente manipulados en el repositorio se pueden usar para ejecutar código. Los parches para este problema están disponibles en la versión 2.2.24 para 2.2 LTS o 2.7.7 para la línea principal. Como workaround, evite instalar dependencias a través de git usando `--prefer-dist` o la configuración de configuración `preferred-install: dist`.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-35241 changed 2025-04-21 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-47f6-5gq3-vx9c changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-35241 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-COMPOSER-2024-35241 changed 2025-05-20 | Apache-2.0 |