CVE-2026-40176: Composer is a dependency manager for PHP
CVE-2026-40176 is a high-severity flaw (CVSS 7.8) affecting composer. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
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, le
Why this priority
- High severity
A fixed release or distro patch exists.
Last updated 2026-07-15 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score
Am I affected?
Timeline
- Published CVE record published
- Updated Record last modified
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Quick answers
How do I fix CVE-2026-40176?
composer: upgrade to newer than 2.9.5. Exact commands for each OS are on this page.
Is CVE-2026-40176 being exploited?
CVE-2026-40176 is not on the CISA Known Exploited Vulnerabilities list at the time of the last update. Check again, as this can change.
What does CVE-2026-40176 affect?
CVE-2026-40176 affects composer. Severity is high (CVSS 7.8). 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-supplie
How urgent is CVE-2026-40176?
Priority 43/100. High severity
Software pages
Related CVEs
- CVE-2026-40261 HIGH 8.8 UPGRADE Composer is a dependency manager for PHP