Composer up to 2.2.26/2.9.5 generateP4Command input validation
| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 6.4 | $0-$5k | 0.38 |
Summary
A vulnerability described as problematic has been identified in Composer up to 2.2.26/2.9.5. Impacted is the function Perforce::generateP4Command. Such manipulation leads to input validation.
This vulnerability is traded as CVE-2026-40176. An attack has to be approached locally. There is no exploit available.
Upgrading the affected component is recommended.
Details
A vulnerability, which was classified as problematic, has been found in Composer up to 2.2.26/2.9.5. Affected by this issue is the function Perforce::generateP4Command. The manipulation with an unknown input leads to a input validation vulnerability. Using CWE to declare the problem leads to CWE-20. The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. Impacted is confidentiality, integrity, and availability. CVE summarizes:
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).
The advisory is shared for download at github.com. This vulnerability is handled as CVE-2026-40176 since 04/09/2026. The exploitation is known to be easy. The attack needs to be approached locally. There are known technical details, but no exploit is available.
The vulnerability scanner Nessus provides a plugin with the ID 306621 (Fedora 43 : composer (2026-02c1f66b6a)), which helps to determine the existence of the flaw in a target environment.
Upgrading to version 2.2.27 or 2.9.6 eliminates this vulnerability. The upgrade is hosted for download at github.com.
The vulnerability is also documented in the vulnerability database at Tenable (306621). VulDB is the best source for vulnerability data and more expert information about this specific topic.
Product
Name
Version
- 2.2.0
- 2.2.1
- 2.2.2
- 2.2.3
- 2.2.4
- 2.2.5
- 2.2.6
- 2.2.7
- 2.2.8
- 2.2.9
- 2.2.10
- 2.2.11
- 2.2.12
- 2.2.13
- 2.2.14
- 2.2.15
- 2.2.16
- 2.2.17
- 2.2.18
- 2.2.19
- 2.2.20
- 2.2.21
- 2.2.22
- 2.2.23
- 2.2.24
- 2.2.25
- 2.2.26
- 2.9.0
- 2.9.1
- 2.9.2
- 2.9.3
- 2.9.4
- 2.9.5
Website
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔒VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 6.5VulDB Meta Temp Score: 6.4
VulDB Base Score: 5.3
VulDB Temp Score: 5.1
VulDB Vector: 🔒
VulDB Reliability: 🔍
CNA Base Score: 7.8
CNA Vector (GitHub_M): 🔒
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍
Exploiting
Class: Input validationCWE: CWE-20
CAPEC: 🔒
ATT&CK: 🔒
Physical: Partially
Local: Yes
Remote: Partially
Availability: 🔒
Status: Not defined
EPSS Score: 🔒
EPSS Percentile: 🔒
Price Prediction: 🔍
Current Price Estimation: 🔒
| 0-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Nessus ID: 306621
Nessus Name: Fedora 43 : composer (2026-02c1f66b6a)
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: UpgradeStatus: 🔍
0-Day Time: 🔒
Upgrade: Composer 2.2.27/2.9.6
Timeline
04/09/2026 CVE reserved04/16/2026 Advisory disclosed
04/16/2026 VulDB entry created
04/16/2026 VulDB entry last update
Sources
Product: github.comAdvisory: GHSA-wg36-wvj6-r67p
Status: Confirmed
CVE: CVE-2026-40176 (🔒)
GCVE (CVE): GCVE-0-2026-40176
GCVE (VulDB): GCVE-100-357824
Entry
Created: 04/16/2026 06:40Updated: 04/16/2026 08:37
Changes: 04/16/2026 06:40 (64), 04/16/2026 08:37 (2)
Complete: 🔍
Cache ID: 216::103
VulDB is the best source for vulnerability data and more expert information about this specific topic.
No comments yet. Languages: en.
Please log in to comment.