CVE-2026-40176: composer · Improper Input Validation
Affects composerSource CVE Database V5
Not known to be exploited · CVSS 7.8 High : upgrade to 2.9.6 or 2.2.27 soon.
Data as of 2 Nov 2026, 23:28 UTC
Sources agree
| CNA (GitHub_M) | CVSS 3.1 | 7.8 |
|---|---|---|
| ADP (redhat-SADP) | CVSS 3.1 | 7.8 |
- CISA SSVC
- Exploitation
- No evidence of active exploitation and no public proof of concept
- Automatable
- Attackers cannot reliably automate steps 1–4 of the kill chain
- Technical impact
- Total control over the software or total information disclosure
CISA SSVC assessment, 2026-04-16.
- Patch
- Available – fixed in 2.9.6, 2.2.27
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 15 Apr 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2 Nov 2026.
What to do
Upgrade composer and composer/composer to 2.9.6 or 2.2.27.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| composercomposer | Affected
| Fixed in
|
| composercomposer | Affected
| Fixed in
|
Packagistcomposer/composerpkg:composer/composer/composerOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Users should upgrade Composer to versions 2.2.27 or 2.9.6 or later where the vulnerability is fixed. Until upgrading, only run Composer commands on trusted projects and carefully inspect composer.json files for suspicious Perforce repository definitions. Avoid running Composer on untrusted or attacker-supplied composer.json files.
Description
Composer versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection vulnerability in the Perforce::generateP4Command() method. This flaw allows an attacker to inject arbitrary shell commands via specially crafted Perforce connection parameters in a malicious composer.json file. Exploitation requires running Composer commands on untrusted projects with attacker-supplied composer.json files. The vulnerability has been fixed in Composer versions 2.2.27 and 2.9.6.
References
- github.com/composer/composer/security/advisories/GHSA-wg36-wvj6-r67p (opens in a new tab)
- access.redhat.com/errata/RHSA-2026:8165 (opens in a new tab)
- access.redhat.com/security/cve/CVE-2026-40176 (opens in a new tab)
- bugzilla.redhat.com/show_bug.cgi?id=2458828 (opens in a new tab)
- github.com/FriendsOfPHP/security-advisories/blob/master/composer/composer/CVE-2026-40176.yaml (opens in a new tab)
- github.com/composer/composer/releases/tag/2.2.27 (opens in a new tab)
- github.com/composer/composer/releases/tag/2.9.6 (opens in a new tab)
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40176.json (opens in a new tab)