CVE-2026-40176
High · 7.8CVSS
7.8
EPSS
1.0%
Published
Apr 15, 2026
CISA due date
—
The record
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).
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| openSUSE:Tumbleweed | php-composer2 | 0 | 2.9.7-1.1 |
Related vulnerabilities
- CVE-2026-40261 Composer is a dependency manager for PHP. Also affects php-composer2
- CVE-2025-67746 Composer is a dependency manager for PHP. Also affects php-composer2
- CVE-2024-35242 Composer is a dependency manager for PHP. Also affects php-composer2
- CVE-2024-35241 Composer is a dependency manager for PHP. Also affects php-composer2
- CVE-2026-113786 pypdf is a free and open-source pure-python PDF library. CWE-20
- CVE-2026-112081 A vulnerability was determined in hankcs HanLP up to 2.1.0-beta.64. CWE-20
- CVE-2026-111869 A vulnerability was identified in makeplane plane up to 1.4.2. CWE-20
- CVE-2026-100347 kin-openapi is a Go project for handling OpenAPI files. CWE-20