Every CVE Search/ Get API key

CVE-2024-35241

Composer vulnerable to command injection via malicious git branch name

8.8 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

1.05%Up 1.0 points since Jun 11, 2024
90%50%10%1%

What each source reports

CVE List Score used 8.8

Composer vulnerable to command injection via malicious git branch name

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.

Record
CVE-2024-35241
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-77
Updated
2026-11-02
EUVDEUVD-2024-1909 8.8

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.

Record
EUVD-2024-1909
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-47f6-5gq3-vx9c 8.8

Composer has a command injection via malicious git branch name

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.

Record
GHSA-47f6-5gq3-vx9c
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-77
Updated
2026-11-02
NVD 8.8

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.

Record
CVE-2024-35241
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-77
Updated
2026-11-02
OSVALPINE-CVE-2024-35241 8.8

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.

Record
ALPINE-CVE-2024-35241
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-03
OSV 8.8

Composer vulnerable to command injection via malicious git branch name

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.

Record
CVE-2024-35241
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-77
Updated
2026-11-02
Show 10 moreShow less
OSVDEBIAN-CVE-2024-35241 8.8

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.

Record
DEBIAN-CVE-2024-35241
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVGHSA-47f6-5gq3-vx9c 8.8

Composer has a command injection via malicious git branch name

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.

Record
GHSA-47f6-5gq3-vx9c
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-77
Updated
2026-11-02
OSVUBUNTU-CVE-2024-35241 8.8

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.

Record
UBUNTU-CVE-2024-35241
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVBIT-composer-2024-35241 No score

Composer vulnerable to command injection via malicious git branch name

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.

Record
BIT-composer-2024-35241
Updated
2026-11-02
OSVopenSUSE-SU-2024:14040-1 No score

php-composer2-2.7.7-1.1 on GA media

These are all security issues fixed in the php-composer2-2.7.7-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:14040-1
Updated
2026-11-02
OSVSUSE-SU-2024:2106-1 No score

Security update for php-composer2

This update for php-composer2 fixes the following issues:

  • CVE-2024-35241: Fixed code execution when installing packages in repository with specially crafted branch names (bsc#1226181).
  • CVE-2024-35242: Fixed command injection via specially crafted branch names during repository cloning (bsc#1226182).
Record
SUSE-SU-2024:2106-1
Updated
2026-11-02
OSVSUSE-SU-2024:2107-1 No score

Security update for php-composer2

This update for php-composer2 fixes the following issues:

  • CVE-2024-35241: Fixed code execution when installing packages in repository with specially crafted branch names (bsc#1226181).
  • CVE-2024-35242: Fixed command injection via specially crafted branch names during repository cloning (bsc#1226182).
Record
SUSE-SU-2024:2107-1
Updated
2026-11-02
OSVSUSE-SU-2026:1970-1 No score

Security update for php-composer2

This update for php-composer2 fixes the following issues

  • CVE-2026-40176: command injection via malicious Perforce repository definition (bsc#1262254).
  • CVE-2026-40261: command injection via malicious Perforce source reference/url (bsc#1262255).

Changes for php-composer2:

  • version update to 2.2.27 (align with upstream LTS version)
  • Security: Hardened git/hg/perforce/fossil identifier validation to ensure branch names starting with - do not cause issues (246f807b, 246f807b, 246f807b)
  • Security: Fixed Perforce unescaped user input in queryP4User shell command (246f807b)
  • Security: Fixed usage of insecure 3DES ciphers when ext-curl is missing (21ffece62)
  • Fixed issue handling paths with = in them on Windows (#11568)
  • version 2.2.26 2025-12-30
  • Security: Fixed ANSI sequence injection (GHSA-59pp-r3rg-353g / CVE-2025-67746)
  • version 2.2.25 2024-12-11
  • Fixed deprecation notices appearing on this LTS version in case it is used on modern PHP. Modern PHP support is not guaranteed nor tested for though and the main purpose of LTS releases is legacy PHP versions support. (#12217)
  • Fixed issue on plugin upgrade when it defines multiple classes (#12226)
  • Fixed duplicate errors appearing in the output depending on php settings (#12214)
  • Fixed InstalledVersions returning duplicate data in some instances (#12225)
  • version 2.2.24 2024-06-10
  • Security: Fixed command injection via malicious git branch name (GHSA-47f6-5gq3-vx9c / CVE-2024-35241)
  • Security: Fixed multiple command injections via malicious git/hg branch names (GHSA-v9qv-c7wm-wgmf / CVE-2024-35242)
  • Security: Fixed secure-http checks that could be bypassed by using malformed URL formats (fa3b9582c)
  • Security: Fixed Filesystem::isLocalPath including windows-specific checks on linux (3c37a67c)
  • Security: Fixed perforce argument escaping (3773f775)
  • Security: Fixed handling of zip bombs when extracting archives (de5f7e32)
  • Security: Fixed Windows command parameter escaping to prevent abuse of unicode characters with best fit encoding
  • conversion (3130a7455, 04a63b324)
  • version 2.2.23 2024-02-08
  • Security: Fixed code execution and possible privilege escalation via compromised vendor dir contents (GHSA-7c6p-848j-wh5h / CVE-2024-24821)
  • version 2.2.22 2023-09-29
  • Security: Fixed possible remote code execution vulnerability if composer.phar is publicly accessible, executable as PHP, and register_argc_argv is enabled in php.ini (GHSA-jm6m-4632-36hf / CVE-2023-43655)
  • Fixed authentication issue when downloading several files from private Bitbucket in parallel (#11464)
  • Fixed handling of broken junctions on windows (#11550)
  • Fixed loading of root aliases on path repo packages when doing partial updates (#11632)
  • Fixed parsing of lib-curl-openssl version with OSX SecureTransport (#11534)
  • Fixed binary proxies not being transparent when included by another PHP process and returning a value (#11454)
  • Fixed support for plugin classes being marked as readonly (#11404)
  • Fixed GitHub rate limit reporting (#11366)
  • Fixed issue displaying solver problems with branch names containing % signs (#11359)
  • version 2.2.21 2023-02-15
  • Fixed extra.plugin-optional support in PluginInstaller when doing pre-install checks (#11326)
  • version 2.2.20 2023-02-10
  • Added extra.plugin-optional support for allow auto-disabling unknown plugins which are not critical when running non-interactive (#11315)
  • version 2.2.19 2023-02-04
  • Fixed URL sanitizer to handle new GitHub personal access tokens format (#11137)
  • Fixed cache keys to allow _ to avoid conflicts between package names like a-b and a_b (#11229)
  • Fixed handling of --ignore-platform-req with upper-bound ignores to not apply to conflict rules (#11037)
  • Fixed handling of COMPOSER_DISCARD_CHANGES when set to 0
  • version 2.2.18 2022-08-20
  • Fixed COMPOSER_NO_DEV so it also works with require and remove's --update-no-dev (#10995)
  • Fixed duplicate missing extension warnings being…
Record
SUSE-SU-2026:1970-1
Updated
2026-11-02
OSVSUSE-SU-2026:3105-1 No score

Security update for php-composer2

This update for php-composer2 fixes the following issues:

  • CVE-2026-45793: Github Actions issued GITHUB_TOKEN disclosure in GitHub Actions logs (bsc#1271504).
  • CVE-2026-59946: path traversal in package bin field lets dependencies chmod arbitrary host files (bsc#1271151).
  • CVE-2026-59947: URL-embedded HTTP-Basic username leaks to verbose logs (bsc#1271129).
  • CVE-2026-59948: arbitrary file write outside vendordirectory via malicious transitive package name (bsc#1271122).
Record
SUSE-SU-2026:3105-1
Updated
2026-11-02
OSVUSN-7603-1 No score

composer vulnerabilities

Thomas Chauchefoin discovered that Composer did not correctly handle certain arguments. An attacker could possibly use this issue to execute arbitrary code. This issue only affected Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2022-24828, CVE-2023-43655)

Ed Cradock discovered that Composer did not correctly handle the exclusion of certain files. An attacker could possibly use this issue to execute arbitrary code. This issue only affected Ubuntu 22.04 LTS. (CVE-2024-24821)

Martin Haunschmid discovered that Composer did not correctly handle git branch names. An attacker could possibly use this issue to execute arbitrary code. (CVE-2024-35241)

Maciej Piechota discovered that Composer did not correctly handle VCS branch names. An attacker could possibly use this issue to execute arbitrary code. (CVE-2024-35242)

Record
USN-7603-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
composer/composer
Packagist
2.0 up to 2.2.24
2.2.24
composer/composer
Packagist
2.3 up to 2.7.7
2.7.7
composer
Alpine:v3.19
before 2.7.7-r0
2.7.7-r0
composer
Alpine:v3.20
before 2.7.7-r0
2.7.7-r0
composer
Alpine:v3.21
before 2.7.7-r0
2.7.7-r0
composer
Alpine:v3.22
before 2.7.7-r0
2.7.7-r0
composer
Alpine:v3.23
before 2.7.7-r0
2.7.7-r0
composer
Alpine:v3.24
before 2.7.7-r0
2.7.7-r0
composer
Bitnami
2.0.0 up to 2.2.24, 2.3.0 up to 2.7.7
2.2.242.7.7
composer
Debian:12
before 2.5.5-1+deb12u2, plus listed versions
2.5.5-12.5.5-1+deb12u1
2.5.5-1+deb12u2
Show 30 moreShow less
Affected packages
PackageAffectedFixed
composer
Debian:13
before 2.7.7-1
2.7.7-1
composer
Debian:14
before 2.7.7-1
2.7.7-1
composer
Debian:10
From an advisory covering 2 CVEs
before 1.8.4-1+deb10u4, plus listed versions
1.8.4-11.8.4-1+deb10u11.8.4-1+deb10u21.8.4-1+deb10u3
1.8.4-1+deb10u4
composer
Debian:11
From an advisory covering 2 CVEs
before 2.0.9-2+deb11u3, plus listed versions
2.0.9-22.0.9-2+deb11u12.0.9-2+deb11u2
2.0.9-2+deb11u3
composer
Debian:12
From an advisory covering 2 CVEs
before 2.5.5-1+deb12u2, plus listed versions
2.5.5-12.5.5-1+deb12u1
2.5.5-1+deb12u2
composer/composer
Packagist
2.0 up to 2.2.24, plus listed versions
2.0.02.0.0-RC12.0.0-RC22.0.0-alpha12.0.0-alpha2
Show 45 moreShow less
2.0.0-alpha32.0.12.0.102.0.112.0.122.0.132.0.142.0.22.0.32.0.42.0.52.0.62.0.72.0.82.0.92.1.02.1.0-RC12.1.12.1.102.1.112.1.122.1.142.1.22.1.32.1.42.1.52.1.62.1.72.1.82.1.92.2.02.2.0-RC12.2.12.2.102.2.112.2.122.2.132.2.142.2.152.2.162.2.172.2.182.2.192.2.22.2.20
2.2.24
composer/composer
Packagist
2.3 up to 2.7.7, plus listed versions
2.3.02.3.0-RC12.3.0-RC22.3.12.3.10
Show 37 moreShow less
2.3.22.3.32.3.42.3.52.3.62.3.72.3.82.3.92.4.02.4.0-RC12.4.12.4.22.4.32.4.42.5.02.5.12.5.22.5.32.5.42.5.52.5.62.5.72.5.82.6.02.6.12.6.22.6.32.6.42.6.52.6.62.7.02.7.12.7.22.7.32.7.42.7.52.7.6
2.7.7
php-composer2
SUSE:Linux Enterprise Module for Web and Scripting 15 SP5
From an advisory covering 2 CVEs
before 2.2.3-150400.3.12.1
2.2.3-150400.3.12.1
php-composer2
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS
From an advisory covering 2 CVEs
before 2.2.3-150400.3.12.1
2.2.3-150400.3.12.1
php-composer2
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS
From an advisory covering 2 CVEs
before 2.2.3-150400.3.12.1
2.2.3-150400.3.12.1
php-composer2
SUSE:Linux Enterprise Server 15 SP4-LTSS
From an advisory covering 2 CVEs
before 2.2.3-150400.3.12.1
2.2.3-150400.3.12.1
php-composer2
SUSE:Linux Enterprise Server for SAP Applications 15 SP4
From an advisory covering 2 CVEs
before 2.2.3-150400.3.12.1
2.2.3-150400.3.12.1
php-composer2
SUSE:Manager Server 4.3
From an advisory covering 2 CVEs
before 2.2.3-150400.3.12.1
2.2.3-150400.3.12.1
php-composer2
openSUSE:Leap 15.5
From an advisory covering 2 CVEs
before 2.2.3-150400.3.12.1
2.2.3-150400.3.12.1
php-composer2
SUSE:Linux Enterprise Module for Web and Scripting 15 SP6
From an advisory covering 2 CVEs
before 2.6.4-150600.3.3.1
2.6.4-150600.3.3.1
php-composer2
openSUSE:Leap 15.6
From an advisory covering 2 CVEs
before 2.6.4-150600.3.3.1
2.6.4-150600.3.3.1
php-composer2
SUSE:Linux Enterprise Module for Web and Scripting 15 SP7
From an advisory covering 9 CVEs
before 2.6.4-150600.3.12.1
2.6.4-150600.3.12.1
php-composer2
SUSE:Linux Enterprise Server 15 SP6-LTSS
From an advisory covering 9 CVEs
before 2.6.4-150600.3.12.1
2.6.4-150600.3.12.1
php-composer2
SUSE:Linux Enterprise Server for SAP Applications 15 SP6
From an advisory covering 9 CVEs
before 2.6.4-150600.3.12.1
2.6.4-150600.3.12.1
composer
Ubuntu:Pro:16.04:LTS
before 1.0.0~beta2-1ubuntu0.1~esm2, plus listed versions
1.0.0~alpha10+20150602-11.0.0~alpha10+20150602-21.0.0~alpha11-11.0.0~alpha11-1ubuntu11.0.0~alpha11-2
Show 4 moreShow less
1.0.0~alpha11-31.0.0~beta1-1ubuntu11.0.0~beta2-11.0.0~beta2-1ubuntu0.1~esm1
1.0.0~beta2-1ubuntu0.1~esm2
composer
Ubuntu:Pro:18.04:LTS
before 1.6.3-1ubuntu0.1~esm2, plus listed versions
1.5.1-11.5.2-11.6.2-11.6.3-11.6.3-1ubuntu0.1~esm1
1.6.3-1ubuntu0.1~esm2
composer
Ubuntu:Pro:20.04:LTS
before 1.10.1-1ubuntu0.1~esm2, plus listed versions
1.9.0-21.9.1-11.9.2-11.9.3-11.10.0-11.10.1-11.10.1-1ubuntu0.1~esm1
1.10.1-1ubuntu0.1~esm2
composer
Ubuntu:Pro:22.04:LTS
before 2.2.6-2ubuntu4+esm1, plus listed versions
2.0.9-2ubuntu22.0.9-2ubuntu32.0.13-1ubuntu12.1.12-1ubuntu12.2.6-2ubuntu4
2.2.6-2ubuntu4+esm1
composer
Ubuntu:Pro:24.04:LTS
before 2.7.1-2ubuntu0.1~esm1, plus listed versions
2.5.8-12.6.5-12.6.6-12.7.1-2
2.7.1-2ubuntu0.1~esm1
composer
Ubuntu:Pro:16.04:LTS
From an advisory covering 5 CVEs
before 1.0.0~beta2-1ubuntu0.1~esm2, plus listed versions
1.0.0~alpha10+20150602-11.0.0~alpha10+20150602-21.0.0~alpha11-11.0.0~alpha11-1ubuntu11.0.0~alpha11-2
Show 4 moreShow less
1.0.0~alpha11-31.0.0~beta1-1ubuntu11.0.0~beta2-11.0.0~beta2-1ubuntu0.1~esm1
1.0.0~beta2-1ubuntu0.1~esm2
composer
Ubuntu:Pro:18.04:LTS
From an advisory covering 5 CVEs
before 1.6.3-1ubuntu0.1~esm2, plus listed versions
1.5.1-11.5.2-11.6.2-11.6.3-11.6.3-1ubuntu0.1~esm1
1.6.3-1ubuntu0.1~esm2
composer
Ubuntu:Pro:20.04:LTS
From an advisory covering 5 CVEs
before 1.10.1-1ubuntu0.1~esm2, plus listed versions
1.9.0-21.9.1-11.9.2-11.9.3-11.10.0-11.10.1-11.10.1-1ubuntu0.1~esm1
1.10.1-1ubuntu0.1~esm2
composer
Ubuntu:Pro:22.04:LTS
From an advisory covering 5 CVEs
before 2.2.6-2ubuntu4+esm1, plus listed versions
2.0.9-2ubuntu22.0.9-2ubuntu32.0.13-1ubuntu12.1.12-1ubuntu12.2.6-2ubuntu4
2.2.6-2ubuntu4+esm1
composer
Ubuntu:Pro:24.04:LTS
From an advisory covering 5 CVEs
before 2.7.1-2ubuntu0.1~esm1, plus listed versions
2.5.8-12.6.5-12.6.6-12.7.1-2
2.7.1-2ubuntu0.1~esm1
php-composer2
openSUSE:Tumbleweed
From an advisory covering 2 CVEs
before 2.7.7-1.1
2.7.7-1.1

History

History
RecordedChangedSources
affected, facts
affected, aliases, referencesOSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-35241 is a high vulnerability (CVSS 8.8) in Composer, published June 10, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.05%, the 64th percentile. Fixed in composer/composer 2.2.24.

References

Show 38 moreShow less
This page doesn't list everything

Left out here: 10 versions and the rest of 1 source description. The JSON record has them.

MoveEnter Open