# CVE-2026-40176: composer: Composer is a dependency manager for PHP

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

- Web page: https://patchblox.com/security/cve/CVE-2026-40176
- Priority: High
- CVSS: 7.8 (high)
- EPSS: 0.0105
- 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::generateP4Command() method, which constructs shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping. An attacker can inject arbitrary commands through these values in a malicious composer.json declaring a Perforce VCS repository, leading to command execution in the context of the user running Composer, even if Perforce is not installed. VCS repositories are only loaded from the root composer.json or the composer config directory, so this cannot be exploited through composer.json files of packages installed as dependencies. Users are at risk if they run Composer commands on untrusted projects with attacker-supplied composer.json files. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline).

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | composer Debian 12.15 (bookworm) | 2.5.5-1+deb12u4 | [DEBIAN-CVE-2026-40176](https://patchblox.com/security/data/fix/linux/debian-cve-2026-40176.md) | Apr 15, 2026 |
| Linux | composer Debian 13.5 (trixie) | 2.8.8-1+deb13u2 | [DEBIAN-CVE-2026-40176](https://patchblox.com/security/data/fix/linux/debian-cve-2026-40176.md) | Apr 15, 2026 |
| Linux | composer Debian 14 | 2.9.7-1 | [DEBIAN-CVE-2026-40176](https://patchblox.com/security/data/fix/linux/debian-cve-2026-40176.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.
