CVE-2026-40176
Last modified
CVE-2026-40176 is a high-severity vulnerability rated 7.8/10 on the CVSS scale. 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. EPSS estimates a 1.06% chance of exploitation in the next 30 days.
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).
Metrics
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness Enumeration
Affected Software
| Vendor | Product | Versions |
|---|---|---|
| Getcomposer | Composer | >= 1.0.0, <= 2.2.26 |
| Getcomposer | Composer | >= 2.3.0, <= 2.9.5 |
References
Timeline
- Published
- Last Modified
- Status
- Modified
Frequently Asked Questions
What is CVE-2026-40176?
How severe is CVE-2026-40176?
How do I fix CVE-2026-40176?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2026
- CVE-2026-40170ngtcp2 is a C implementation of the IETF QUIC protocol. In v…7.5
- CVE-2026-40171In Jupyter Notebook versions 7.0.0 through 7.5.5, JupyterLab…8.4
- CVE-2026-40172authentik is an open-source identity provider. In versions p…8.1
- CVE-2026-40173Dgraph is an open source distributed GraphQL database. Versi…9.4
- CVE-2026-40174Masa CMS is a content management system forked from Mura CMS…7.1
- CVE-2026-40175Axios is a promise based HTTP client for the browser and Nod…4.8
- CVE-2026-40177ajenti.plugin.core defines all necessary core elements to al…7.5
- CVE-2026-40178ajenti.plugin.core defines all necessary core elements to al…5.9
- CVE-2026-40179Prometheus is an open-source monitoring system and time seri…6.1
- CVE-2026-4018TOCTOU Race Condition in specific trace commands of the Trac…6.4
- CVE-2026-40180Quarkus OpenAPI Generator is Quarkus' extensions for generat…7.5
- CVE-2026-40181React Router is a router for React. In versions 7.0.0 throug…6.1
Are you affected by CVE-2026-40176?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
