Skip to content
OpenAdvisories
High · 8.8 CVE-2024-35241 BIT-composer-2024-35241EUVD-2024-1909GHSA-47f6-5gq3-vx9c

Composer vulnerable to command injection via malicious git branch name

Published Jun 10, 2024 · Updated Apr 21, 2025 · 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 `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 products

VendorProductAffectedFixed
composer composer >= 2.0, < 2.2.24, >= 2.3, < 2.7.7 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 composer 2.7.7-1 —
Debian 13 composer 2.7.7-1 —
Debian 12 composer 2.5.5-1+deb12u2 DSA-5715-1
Debian 11 composer 2.0.9-2+deb11u3 DSA-5715-1
Debian 10 composer 1.8.4-1+deb10u4 DLA-3838-1
ReleasePackageFixed inAdvisory
Ubuntu Pro 24.04 LTS composer 2.7.1-2ubuntu0.1~esm1 USN-7603-1
Ubuntu Pro 22.04 LTS composer 2.2.6-2ubuntu4+esm1 USN-7603-1
Ubuntu Pro 20.04 LTS composer 1.10.1-1ubuntu0.1~esm2 USN-7603-1
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 18.04 LTS composer 1.6.3-1ubuntu0.1~esm2 USN-7603-1
Ubuntu Pro 16.04 LTS composer 1.0.0~beta2-1ubuntu0.1~esm2 USN-7603-1
ReleasePackageFixed inAdvisory
SLES 15 SP7 php-composer2 2.6.4-150600.3.12.1 SUSE-SU-2026:3105-1
SLES 15 SP6 php-composer2 2.6.4-150600.3.3.1 SUSE-SU-2026:3105-1, SUSE-SU-2024:2107-1
SLES 15 SP5 php-composer2 2.2.3-150400.3.12.1 SUSE-SU-2024:2106-1
SLES 15 SP4 php-composer2 2.2.3-150400.3.12.1 SUSE-SU-2024:2106-1
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP6 php-composer2 2.6.4-150600.3.12.1 SUSE-SU-2026:3105-1
SLES for SAP 15 SP4 php-composer2 2.2.3-150400.3.12.1 SUSE-SU-2024:2106-1
SLE HPC 15 SP4 php-composer2 2.2.3-150400.3.12.1 SUSE-SU-2024:2106-1
SUSE Manager Server 4.3 php-composer2 2.2.3-150400.3.12.1 SUSE-SU-2024:2106-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed php-composer2 2.7.7-1.1 openSUSE-SU-2024:14040-1
openSUSE Leap 15.6 php-composer2 2.6.4-150600.3.3.1 SUSE-SU-2024:2107-1
openSUSE Leap 15.5 php-composer2 2.2.3-150400.3.12.1 SUSE-SU-2024:2106-1
ReleasePackageFixed inAdvisory
Alpine v3.24 composer 2.7.7-r0 —
Alpine v3.23 composer 2.7.7-r0 —
Alpine v3.22 composer 2.7.7-r0 —
Alpine v3.21 composer 2.7.7-r0 —
Alpine v3.20 composer 2.7.7-r0 —
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 composer 2.7.7-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 composer 2.5.8-2.amzn2023.0.3 ALAS2023-2024-650

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling composer 2.7.7-r0 —

Affected packages

EcosystemPackageAffectedFixedRecord
Packagist composer/composer >= 2.0, < 2.2.24 2.2.24 GHSA-47f6-5gq3-vx9c
Packagist composer/composer >= 2.3, < 2.7.7 2.7.7 GHSA-47f6-5gq3-vx9c

Advisories 8

References