CVE-2026-40176
CVE-2026-40176 is a high-severity vulnerability in Getcomposer Composer with a CVSS 3.x base score of 7.8. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-20.
Key facts
- Severity: High (CVSS 3.x base score 7.8)
- EPSS exploit prediction: 1% (61st percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2026-23118
- Weakness: CWE-20
- Affected product: Getcomposer Composer
- Published:
- Last modified:
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).
Frequently asked questions
- What is CVE-2026-40176?
- 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).
- How severe is CVE-2026-40176?
- CVE-2026-40176 has a CVSS 3.x base score of 7.8, rated high severity. It is exploitable over local access with low attack complexity, requires no privileges and user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2026-40176 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (61st percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2026-40176?
- CVE-2026-40176 affects Getcomposer Composer. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2026-40176?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
- Does CVE-2026-40176 have an EU (EUVD) identifier?
- Yes. CVE-2026-40176 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2026-23118.
- When was CVE-2026-40176 published?
- CVE-2026-40176 was published on 2026-04-15 and last updated on 2026-06-30.
References
- https://github.com/composer/composer/releases/tag/2.9.6
- https://github.com/composer/composer/security/advisories/GHSA-wg36-wvj6-r67p
- https://access.redhat.com/errata/RHSA-2026:8165
- https://access.redhat.com/security/cve/CVE-2026-40176
- https://bugzilla.redhat.com/show_bug.cgi?id=2458828
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40176.json
Affected products (1)
- cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:*
More vulnerabilities in Getcomposer Composer
- CVE-2026-40261 — High (CVSS 8.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…
- CVE-2024-24821 — High (CVSS 8.8): Composer is a dependency Manager for the PHP language. In affected versions several files within the local working…
- CVE-2015-8371 — High (CVSS 8.8): Composer before 2016-02-10 allows cache poisoning from other projects built on the same host. This results in…
- CVE-2021-29472 — High (CVSS 8.8): Composer is a dependency manager for PHP. URLs for Mercurial repositories in the root composer.json and package source…
- CVE-2022-24828 — High (CVSS 8.3): Composer is a dependency manager for the PHP programming language. Integrators using Composer code to call…
- CVE-2021-41116 — High (CVSS 8.2): Composer is an open source dependency manager for the PHP language. In affected versions windows users running Composer…
All CVEs affecting Getcomposer Composer →
Other CWE-20 (Improper Input Validation) vulnerabilities
- CVE-2026-48316 — Critical (CVSS 10.0): ColdFusion versions 2025.9, 2023.20 and earlier are affected by an Improper Input Validation vulnerability that could…
- CVE-2026-48281 — Critical (CVSS 10.0): ColdFusion versions 2025.9, 2023.20 and earlier are affected by an Improper Input Validation vulnerability that could…
- CVE-2026-48277 — Critical (CVSS 10.0): ColdFusion versions 2025.9, 2023.20 and earlier are affected by an Improper Input Validation vulnerability that could…
- CVE-2026-48055 — Critical (CVSS 10.0): Streambert is a cross-platform Electron Desktop App to stream and download any video media. In versions 2.4.0 and…
- CVE-2026-34910 — Critical (CVSS 10.0): A malicious actor with access to the network could exploit an Improper Input Validation vulnerability found in UniFi OS…
- CVE-2026-33587 — Critical (CVSS 10.0): Lack of user input sanitisation in Open Notebook v1.8.3 allows the application user to execute Python code (and…
Browse all CWE-20 (Improper Input Validation) vulnerabilities →