CVEfocus › CVE database › CVE-2024-35242

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

CVSS 8.8 HighEPSS 4.6% (higher than 92% of CVEs)Published 2024-06-10Updated 2025-02-13Assigner: 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 `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.

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-35242
Ubuntu 22.04composerFix pending2.2.6-2ubuntu4+esm1 (Ubuntu Pro)UBUNTU-CVE-2024-35242
Ubuntu 20.04composerFix pending1.10.1-1ubuntu0.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2024-35242
Ubuntu 18.04composerFix pending1.6.3-1ubuntu0.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2024-35242
Ubuntu 16.04composerFix pending1.0.0~beta2-1ubuntu0.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2024-35242
Debian 14composerFixed2.7.7-1DEBIAN-CVE-2024-35242
Debian 13composerFixed2.7.7-1DEBIAN-CVE-2024-35242
Debian 12composerFixed2.5.5-1+deb12u2DEBIAN-CVE-2024-35242
Alpine Linux 3.24composerFixed2.7.7-r0ALPINE-CVE-2024-35242
Alpine Linux 3.23composerFixed2.7.7-r0ALPINE-CVE-2024-35242
Alpine Linux 3.22composerFixed2.7.7-r0ALPINE-CVE-2024-35242
Alpine Linux 3.21composerFixed2.7.7-r0ALPINE-CVE-2024-35242
Alpine Linux 3.20composerFixed2.7.7-r0ALPINE-CVE-2024-35242
Alpine Linux 3.19composerFixed2.7.7-r0ALPINE-CVE-2024-35242
Packagist librarycomposer/composerFixed2.7.7GHSA-v9qv-c7wm-wgmf

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.