Read the docs
TI-2026-28990 Aliases CVE-2026-40176GHSA-wg36-wvj6-r67p

Composer is vulnerable to Command Injection via Malicious Perforce Repository

Priority LOW 38CWE-20Published · Updated

Key facts

Attack vector
Local
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-78.

Summary

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

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.01045 64th percentileScored 2026-11-07
Fix Fixed composer (composer): 2.9.6, 2.2.27composer/composer (Packagist): 2.9.6, 2.2.27Red Hat: 1 advisory

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
composercomposer2.3 to before 2.9.6; 1.0 to before 2.2.272.9.6, 2.2.27Patch availableCNA
—composer/composer (Packagist)2.3.0 to before 2.9.62.9.6Patch availableGHSA-wg36-wvj6-r67p
—composer/composer (Packagist)1.0.0 to before 2.2.272.2.27Patch availableGHSA-wg36-wvj6-r67p
  • composer Vendorcomposer Affected 2.3 to before 2.9.6; 1.0 to before 2.2.27 Fixed in 2.9.6, 2.2.27 Patch available CNA
  • composer/composer (Packagist) Vendor— Affected 2.3.0 to before 2.9.6 Fixed in 2.9.6 Patch available GHSA-wg36-wvj6-r67p
  • composer/composer (Packagist) Vendor— Affected 1.0.0 to before 2.2.27 Fixed in 2.2.27 Patch available GHSA-wg36-wvj6-r67p

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:*1.0.0 – 2.2.26; 2.3.0 – 2.9.5Vulnerablecomposer
  • cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:* Versions 1.0.0 – 2.2.26; 2.3.0 – 2.9.5 Vulnerable ·composer

Remediation

  • Fix · CNA composer (composer) Fixed in 2.9.6, 2.2.27
  • Fix · GHSA-wg36-wvj6-r67p composer/composer (Packagist) Fixed in 2.9.6 Advisory →
  • Fix · GHSA-wg36-wvj6-r67p composer/composer (Packagist) Fixed in 2.2.27 Advisory →

Red Hat 1 advisory

  • RHSA-2026:8165 Released 2026-04-14 · Red Hat rating Important
    Red Hat Hardened Images RPMs bug fix and enhancement update
    • Red Hat Hardened Images composer-2.9.7-1.hum1@noarch@public-hummingbird-aarch64-rpms, composer-2.9.7-1.hum1@noarch@public-hummingbird-x86_64-rpms, composer-2.9.7-1.hum1@src

Vendor assessments

Red Hat

Red Hat rating: Important. Red Hat's page for this CVE →

ProductStatusPlan or fix
Red Hat Hardened ImagesFixed RHSA-2026:8165

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-40176
  2. 2026-10-03 Alias added: GHSA-wg36-wvj6-r67p
  3. 2026-11-02 6 new references · CNA
  4. 2026-11-02 1 new reference · GHSA-wg36-wvj6-r67p

References

  • TI-2015-06892 Composer before 2016-02-10 allows cache poisoning from other projects built on the same… CVSS 3.1HIGH 8.8
  • TI-2021-17955 Command injection in composer on Windows CVSS 3.1CRITICAL 9.8
  • TI-2021-10185 Code injection in composer CVSS 3.1HIGH 8.8
  • TI-2022-08641 Missing input validation can lead to command execution in composer CVSS 3.1HIGH 8.8
  • TI-2026-29055 Composer has Command Injection via Malicious Perforce Reference CVSS 3.1HIGH 8.8
  • TI-2023-23380 Remote Code Execution via web-accessible composer.phar CVSS 3.1HIGH 8.8
See all 8 →

Sources