
CVE catalog
CVE-2026-40261
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 $sourceR
- Severity
- High · CVSS 8.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Published
- Source
- [NVD] · [CVE record]
- EPSS
- 1.69% · 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::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.
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 |
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 |
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
Observed:
References
- [https://ftp.suse.com/pub/projects/security/csaf/suse-su-2026_3105-1.json]
- [https://nvd.nist.gov/vuln/detail/CVE-2026-40261]
- [https://osv.dev/vulnerability/DEBIAN-CVE-2026-40261]
- [https://security-tracker.debian.org/tracker/CVE-2026-40261]
- [https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40261.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]