CVE-2026-40176
CVE-2026-40176 — Composer is vulnerable to Command Injection via Malicious Perforce Repository
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…
Published Updated Sources: cvelistV5, GitHub_M
Triage
Is it exploited, how likely is exploitation, what does it touch, and how severe do the scoring sources call it.
Exploitation
Public exploit
exploit code published, no use observed
EPSS
1%
chance of exploitation in 30 days
CVSS base
7.8
HIGH
CISA SSVC assessment
Three decision points CISA publishes for the CVEs it assesses · SSVC 2.0.3. A stakeholder decision, not a severity score.
Exploitation
None
none · proof-of-concept · active
Automatable
No
can an attacker script all four kill-chain steps
Technical impact
Total
partial · total control of the vulnerable component
Affected scope
The catalog records vendors and products as separate lists, not pairs, so which product belongs to which vendor is not something this page can say.
Every base score collected
Sources score independently and disagree; each row says who scored it and under which version.
| Score | Version | Severity | Expl. | Impact | Source |
|---|---|---|---|---|---|
| 7.8 | CVSS 3.1 | HIGH | n/a | n/a | cvelistV5 |
Weakness & attack patterns
- CWE-20
- CWE-78
Attack patterns reported against this CVE. The ATT&CK techniques below are inferred from its weakness class.
- T1562.003Impair Defenses: Impair Command History Logging
- T1574.006Hijack Execution Flow: Dynamic Linker Hijacking
- T1574.007Hijack Execution Flow: Path Interception by PATH Environment Variable
Public exploit
Capability, not use: code existing is a different claim from anyone running it.
Indexed by
References
6 on the record
- github.com/composer/composer/security/advisories/GHSA-wg36-wvj6-r67p
x_refsource_CONFIRM
- github.com/composer/composer/releases/tag/2.9.6
x_refsource_MISC
- access.redhat.com/security/cve/CVE-2026-40176
vdb-entry, x_refsource_REDHAT
- bugzilla.redhat.com/show_bug.cgi?id=2458828
issue-tracking, x_refsource_REDHAT
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40176.json
x_sadp-csaf-vex
- access.redhat.com/errata/RHSA-2026:8165
vendor-advisory, x_refsource_REDHAT
Related CVEs
Same product first, then the same weakness or threat actor.
- CVE-2026-129975 Gpgme: gpgme: double free in read_status() via crafted signatureCVSS 8.1
- CVE-2026-137898 Pam: linux-pam pam_econf local privilege escalation via relative "(null)" config directory from empty vendor directory handlingCVSS 7.3
- CVE-2026-135901 Shadow-utils: shadow-utils: newgidmap and newuidmap improperly validate file descriptor location, allowing local file corruption via bind mountCVSS 4.4
- CVE-2026-105134 Ahsay AhsayCBS Replication Receiver UpdateReceivers.do os command injectionCVSS 10.0 · CISA KEV
- CVE-2026-93952 Security Advisory 0183CVSS 10.0 · CISA KEV
- CVE-2026-49869 Kestra: Unauthenticated Remote Code Execution via Authentication Bypass in `AuthenticationFilter`CVSS 10.0 · CISA KEV
Elsewhere on this site
Not in any source we poll
Listed rather than left blank: an empty field and an unmeasured one look identical on screen, and only one is a reason to look elsewhere.
- No confirmed IOCs, IP addresses, domains, file hashes, or malware artifacts supplied.
- No organization-specific asset inventory, compensating-control status, or patch deployment evidence supplied.
- No exploit packet captures, log samples, or incident case IDs supplied.