KEVWire

Security intelligence, with context.

Response snapshot Nov 2, 2026, 23:56 UTC

Back to the wire
Permalink
VulnerabilityCVE-2026-40176

Composer has a command injection via malicious perforce repository

The Perforce::generateP4Command() method constructed shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping. An attacker controlling a repository configuration in a malicious composer.

At a glance

Exploited
Not known
Severity
7.8 High (CVSS 3.1)
Chance of exploitation
1.0% in the next 30 days
Sources
2 independent sources

What to do

GitHub lists first patched versions: composer/composer: 2.9.6; composer/composer: 2.2.27. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-wg36-wvj6-r67p (opens a new tab)

What happened

Impact

The Perforce::generateP4Command() method constructed shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping. An attacker controlling a repository configuration in a malicious composer.json declaring a Perforce VCS repository could inject arbitrary commands through these values, leading to command execution in the context of the user running Composer.

Composer would execute these injected commands even if Perforce is not installed.

VCS repositories are only loaded from the root composer.json file located in the directory you execute Composer commands in and from the composer config directory (e.g. ~/.config/composer/composer.json). So this vulnerability cannot be exploited through composer.json files of packages installed as dependencies.

Continue reading

You are at risk of command execution if you run Composer commands on untrusted projects with attacker supplied composer.json files, regardless of whether you or any of your dependencies use Perforce.

Patches

Fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline)

Workarounds

- Carefully inspect composer.json files before running Composer on them. Verify that Perforce-related fields contain valid values. - Only run Composer commands on projects from trusted sources.

Affected package ranges reported by GitHub: composer/composer: >= 2.3.0, < 2.9.6 composer/composer: >= 1.0.0, < 2.2.27

Scores and how they were measured

CVSS base severity

7.8

Version 3.1As of

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

1.0%

Scored Percentile 64.1%

Model and measurement source (opens a new tab)

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-wg36-wvj6-r67p (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-wg36-wvj6-r67p, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  3. Primary source

    NVD CVE-2026-40176 (opens a new tab)

    NVD record: description, CVSS (the CNA score is preferred), affected products, and publication date. Not evidence of exploitation.

    Published Checked

  4. Primary source

    Vendor advisory (via NVD references) (opens a new tab)

    The vendor advisory referenced by the CVE record, for affected versions and fixes.

    Published Date not suppliedChecked

  5. Primary source

    NVD CVE API 2.0 (opens a new tab)

    The NVD API page that supplied this CVE record.

    Published Date not suppliedChecked

  6. Primary source

    NVD CVE API 2.0 (opens a new tab)

    The NVD API page that supplied this CVE record.

    Published Date not suppliedChecked

  7. Primary source

    FIRST measured EPSS score (opens a new tab)

    Measured EPSS probability and percentile for CVE-2026-40176, scored 2026-11-02. This is a model estimate, not proof of exposure.

    Published Checked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, November 2). Composer has a command injection via malicious perforce repository (CVE-2026-40176). https://kevwire.com/record/CVE-2026-40176

MLA

"Composer has a command injection via malicious perforce repository (CVE-2026-40176)." KEVWire, 2 Nov. 2026, kevwire.com/record/CVE-2026-40176.

Chicago

KEVWire. "Composer has a command injection via malicious perforce repository (CVE-2026-40176)." Last modified November 2, 2026. https://kevwire.com/record/CVE-2026-40176.

Evidence summary (plain text)

Composer has a command injection via malicious perforce repository (Apr 14, 2026).
The Perforce::generateP4Command() method constructed shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping. An attacker controlling a repository configuration in a malicious composer.json declaring a Perforce VCS repository could inject arbitrary commands through these values, leading to command execution in the context of the user running Composer. Composer would execute these injected commands even if Perforce is not installed.
CVSS 7.8 (version 3.1; evidence as of Nov 2, 2026; https://nvd.nist.gov/vuln/detail/CVE-2026-40176).
EPSS 1.0% for the following 30 days, scored Nov 2, 2026 (https://api.first.org/data/v1/epss?cve=CVE-2026-40176&date=2026-11-02).
Sources:
GitHub-reviewed advisory GHSA-wg36-wvj6-r67p: https://github.com/advisories/GHSA-wg36-wvj6-r67p
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc
NVD CVE-2026-40176: https://nvd.nist.gov/vuln/detail/CVE-2026-40176
Vendor advisory (via NVD references): https://github.com/composer/composer/security/advisories/GHSA-wg36-wvj6-r67p
NVD CVE API 2.0: https://services.nvd.nist.gov/rest/json/cves/2.0?lastModStartDate=2026-11-02T22:20:58.510Z&lastModEndDate=2026-11-02T23:55:56.101Z&resultsPerPage=500&startIndex=0
NVD CVE API 2.0: https://services.nvd.nist.gov/rest/json/cves/2.0?lastModStartDate=2026-11-02T21:45:58.195Z&lastModEndDate=2026-11-02T23:20:55.960Z&resultsPerPage=500&startIndex=0
FIRST measured EPSS score: https://api.first.org/data/v1/epss?cve=CVE-2026-40176&date=2026-11-02
Record ID: CVE-2026-40176.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Nov 2, 2026, 23:21 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are coming as part of KEVWire Premium: join the waitlist. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail