# 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.

- Web page: https://patchblox.com/security/cve/CVE-2026-40261
- Priority: High
- CVSS: 8.8 (high)
- EPSS: 0.0169
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Apr 15, 2026

## Description

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

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | composer Debian 12.15 (bookworm) | 2.5.5-1+deb12u4 | [DEBIAN-CVE-2026-40261](https://patchblox.com/security/data/fix/linux/debian-cve-2026-40261.md) | Apr 15, 2026 |
| Linux | composer Debian 13.5 (trixie) | 2.8.8-1+deb13u2 | [DEBIAN-CVE-2026-40261](https://patchblox.com/security/data/fix/linux/debian-cve-2026-40261.md) | Apr 15, 2026 |
| Linux | composer Debian 14 | 2.9.7-1 | [DEBIAN-CVE-2026-40261](https://patchblox.com/security/data/fix/linux/debian-cve-2026-40261.md) | Apr 15, 2026 |
| Linux | composer amzn 2023 | 2.9.7-1.amzn2023.0.1 | [ALAS2023-2026-1625](https://patchblox.com/security/data/fix/linux/alas2023-2026-1625.md) | Apr 27, 2026 |
| Linux | php-composer2 opensuse-leap 16.0 | 2.8.9-160000.4.1 | [OPENSUSE-SU-2026:21520-1](https://patchblox.com/security/data/fix/linux/opensuse-su-2026-21520-1.md) | Aug 3, 2026 |
| Linux | php-composer2 sles 15.6 | 2.6.4-150600.3.12.1 | [SUSE-SU-2026:3105-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-3105-1.md) | Jul 17, 2026 |
| Linux | php-composer2 sles 15.7 | 2.6.4-150600.3.12.1 | [SUSE-SU-2026:3105-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-3105-1.md) | Jul 17, 2026 |
| Linux | php-composer2 sles 16.0 | 2.8.9-160000.4.1 | [SUSE-SU-2026:23138-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-23138-1.md) | Aug 3, 2026 |

---

Data as of 2026-11-08T00:53:09Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

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.
