CVEfocus › CVE database › CVE-2024-35241

CVE-2024-35241Composer vulnerable to command injection via malicious git branch name

CVSS 8.8 HighEPSS 1.5% (higher than 74% of CVEs)Published 2024-06-10Updated 2025-04-21Assigner: GitHub_M

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.

CWE-77

What to do

Fixed builds are available from Alpine, Debian, Packagist: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

10Fixed
5Fix pending
2Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04composerNot affected
vulnerable_code_not_present
Ubuntu 25.10composerNot affected
vulnerable_code_not_present
Ubuntu 24.04composerFix pending2.7.1-2ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2024-35241
Ubuntu 22.04composerFix pending2.2.6-2ubuntu4+esm1 (Ubuntu Pro)UBUNTU-CVE-2024-35241
Ubuntu 20.04composerFix pending1.10.1-1ubuntu0.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2024-35241
Ubuntu 18.04composerFix pending1.6.3-1ubuntu0.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2024-35241
Ubuntu 16.04composerFix pending1.0.0~beta2-1ubuntu0.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2024-35241
Debian 14composerFixed2.7.7-1DEBIAN-CVE-2024-35241
Debian 13composerFixed2.7.7-1DEBIAN-CVE-2024-35241
Debian 12composerFixed2.5.5-1+deb12u2DEBIAN-CVE-2024-35241
Alpine Linux 3.24composerFixed2.7.7-r0ALPINE-CVE-2024-35241
Alpine Linux 3.23composerFixed2.7.7-r0ALPINE-CVE-2024-35241
Alpine Linux 3.22composerFixed2.7.7-r0ALPINE-CVE-2024-35241
Alpine Linux 3.21composerFixed2.7.7-r0ALPINE-CVE-2024-35241
Alpine Linux 3.20composerFixed2.7.7-r0ALPINE-CVE-2024-35241
Alpine Linux 3.19composerFixed2.7.7-r0ALPINE-CVE-2024-35241
Packagist librarycomposer/composerFixed2.7.7GHSA-47f6-5gq3-vx9c

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.