
CVE catalog
CVE-2026-40176
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 shel
- Severity
- High · CVSS 7.8
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Published
- Source
- [NVD] · [CVE record]
- EPSS
- 1.04% · Oct 25, 2026
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).
Vulnerable and fixed packages
Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | composer | sid | 2.10.3-1 | fixed |
| Debian | composer | forky | 2.10.3-1 | fixed |
| Debian | composer | trixie | 2.8.8-1+deb13u3 | fixed |
| Debian | composer | bookworm | 2.5.5-1+deb12u5 | fixed |
| Debian | composer | bookworm-security | 2.5.5-1+deb12u2 | vulnerable |
| Cpe | composer | Not reported | Not reported | unknown |
| Opensuse | php-composer2 | tumbleweed | 2.9.7-1.1 | fixed |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | composer | source | sid | 2.9.7-1 | not yet assigned | Not reported | Not reported |
| Debian | composer | source | forky | 2.9.7-1 | not yet assigned | Not reported | Not reported |
| Debian | composer | source | trixie | 2.8.8-1+deb13u2 | not yet assigned | Not reported | Not reported |
| Debian | composer | source | bookworm | 2.5.5-1+deb12u4 | not yet assigned | Not reported | Not reported |
| Opensuse | php-composer2 | rpm | tumbleweed | 2.9.7-1.1 | Not reported | OPENSUSE-SU-2026:10643-1 | Not reported |
OpenFactory catalog packages
[Debian 12 (Bookworm)]
- [composer]Affected
Details (4)
2.5.5-1+deb12u5· all · bookwormFixed · Fixed:
2.5.5-1+deb12u4nvd · composer · debian · bookworm; nvd · composer · debian · 12
2.5.5-1+deb12u5· all · bookwormFixed · Fixed:
2.5.5-1+deb12u4nvd · composer · debian · bookworm; nvd · composer · debian · 12
2.5.5-1+deb12u2· all · bookworm-securityAffected · Fixed:
2.5.5-1+deb12u4nvd · composer · debian · bookworm; nvd · composer · debian · 12
2.5.5-1+deb12u2· all · bookworm-securityAffected · Fixed:
2.5.5-1+deb12u4nvd · composer · debian · bookworm; nvd · composer · debian · 12
[Debian 13 (Trixie)]
- [composer]Fixed
Details (2)
2.8.8-1+deb13u3· all · trixieFixed · Fixed:
2.8.8-1+deb13u2nvd · composer · debian · 13
2.8.8-1+deb13u3· all · trixieFixed · Fixed:
2.8.8-1+deb13u2nvd · composer · debian · 13
[openSUSE Tumbleweed]
- [php-composer2]Fixed
Source package: [php-composer2]
Details (1)
2.10.3-1.1· noarch · tumbleweedFixed · Fixed:
2.9.7-1.1nvd · php-composer2 · opensuse · tumbleweed
Observed:
References
- [https://ftp.suse.com/pub/projects/security/csaf/suse-su-2026_3105-1.json]
- [https://nvd.nist.gov/vuln/detail/CVE-2026-40176]
- [https://osv.dev/vulnerability/DEBIAN-CVE-2026-40176]
- [https://osv.dev/vulnerability/openSUSE-SU-2026:10643-1]
- [https://security-tracker.debian.org/tracker/CVE-2026-40176]
- [https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40176.json]
- [https://wid.cert-bund.de/.well-known/csaf/white/2026/wid-sec-w-2026-1128.json]
[CERT-Bund public advisories] · [Debian Security Tracker] · [FIRST EPSS] · [National Vulnerability Database (NVD)] · [OSV Package Vulnerability Database] · [Red Hat security advisories and VEX] · [SUSE security advisories and VEX]