CVE-2026-40261

composer: Composer is a dependency manager for PHP

CVE-2026-40261 is fixed in 2 products on 1 platform, first by DEBIAN-CVE-2026-40261, released April 15, 2026. It is not reported as exploited. Patch Radar priority: High.

High
CVSS
8.8
high
Exploitation
None reported
No vendor assessment
CISA KEV
Not listed
Not in the Known Exploited Vulnerabilities catalog
EPSS
0.0169
77th percentile

Composer is a dependency manager for PHP. Versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection vulnerability in the Perforce::syncCodeBase() method, which appends the $sourceReference parameter to a shell command without proper escaping, and additionally in the Perforce::generateP4Command() method as in GHSA-wg36-wvj6-r67p / CVE-2026-40176, which interpolates user-supplied Perforce connection parameters (port, user, client) from the source url field without proper escaping. An attacker can inject arbitrary commands through crafted source reference or source url values containing shell metacharacters, even if Perforce is not installed. Unlike CVE-2026-40176, the source reference and url are provided as part of package metadata, meaning any compromised or malicious Composer repository can serve package metadata declaring perforce as a source type with malicious values. This vulnerability is exploitable when installing or updating dependencies from source, including the default behavior when installing dev-prefixed versions. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline). If developers are unable to immediately update, they can avoid installing dependencies from source by using --prefer-dist or the preferred-install: dist config setting, and only use trusted Composer repositories as a workaround.

Where it's fixed

ProductFixed inFixReleased
Linux
composer · Debian 12.15 (bookworm) 2.5.5-1+deb12u4 DEBIAN-CVE-2026-40261 Apr 15, 2026
composer · Debian 13.5 (trixie) 2.8.8-1+deb13u2 DEBIAN-CVE-2026-40261 Apr 15, 2026
composer · Debian 14 2.9.7-1 DEBIAN-CVE-2026-40261 Apr 15, 2026
composer · amzn 2023 2.9.7-1.amzn2023.0.1 ALAS2023-2026-1625 Apr 27, 2026
php-composer2 · opensuse-leap 16.0 2.8.9-160000.4.1 OPENSUSE-SU-2026:21520-1 Aug 3, 2026
php-composer2 · sles 15.6 2.6.4-150600.3.12.1 SUSE-SU-2026:3105-1 Jul 17, 2026
php-composer2 · sles 15.7 2.6.4-150600.3.12.1 SUSE-SU-2026:3105-1 Jul 17, 2026
php-composer2 · sles 16.0 2.8.9-160000.4.1 SUSE-SU-2026:23138-1 Aug 3, 2026

Patch Radar data is free to use with attribution. Terms and how to credit it.

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.