Skip to main content
VulnerabilityPublished Updated

CVE-2026-40176: composer · Improper Input Validation

Affects composerSource CVE Database V5

0
Compare

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

CVSS 3.1 base score
7.8High
How severe the flaw is on the 0–10 CVSS scale.

Sources agree

CVSS scores by source
CNA (GitHub_M)CVSS 3.17.8
ADP (redhat-SADP)CVSS 3.17.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:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 15 Apr 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
composercomposerAffected
  • >=2.3 <2.9.6
Fixed in
  • 2.9.6
composercomposerAffected
  • >=1.0 <2.2.27
Fixed in
  • 2.2.27
Packagistcomposer/composerpkg:composer/composer/composerOther threatsAffected
  • <2.2.27
  • <2.9.6 >=2.3
Fixed in
  • 2.2.27
  • 2.9.6

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

Community reviews

Loading reviews…