7.8

CVE-2026-40176: composer Improper Input Validation

CVSS: 7.8v3.1HighModified
AliasesUBUNTU-CVE-2026-40176DEBIAN-CVE-2026-40176CGA-6w8f-9cjg-7cxw
Published 15-04-2026Last modified 15-07-2026

Vulnerability summary

CVE-2026-40176 is a high (CVSS 7.8) Improper Input Validation vulnerability in composer. EPSS estimates a 1.00% chance of exploitation in the next 30 days, higher than 62.1% of scored vulnerabilities.

Overall risk
31/100
0100
Medium · default modelHow is this calculated?
CVSS score
7.8/10
010
High · v3.1 (CVE.org)
EPSS score
1.00%
0%100%
Low · -0.07 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 6 · Related 6

Timeline

  1. 15-04-2026
    PublishedVulnerability first disclosed.
  2. 15-07-2026
    Last modifiedVulnerability information updated.

Description

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).

CVSS metrics

6 scores · 6 sources · 1 version

EPSS trend

Probability

1.00%

Chance of exploitation in the next 30 days

Percentile

62%

Versus all other CVEs

30-day change

-0.07 pp

From 1.06% on 19-09-2026

19-09-202619-10-2026
EPSS score
1.00%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Chainguard1 product
  • composer< 2.9.7-r0
Composer1 product
  • composer≥ 2.3, < 2.9.6 | ≥ 1.0, < 2.2.27
Debian1 product
  • composer< 2.5.5-1+deb12u4 | < 2.8.8-1+deb13u2 | < 2.9.7-1
Getcomposer1 product
  • composer≥ 1.0.0, ≤ 2.2.26 | ≥ 2.3.0, ≤ 2.9.5
Ubuntu1 product
  • composerAll versions (No fix recorded)
Wolfi1 product
  • composer< 2.9.7-r0

6 vendors · 6 products

References

11 links
Show all 11 references