CVSS 3.1
7.8 highCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HHigh (7.8) in getcomposer composer. EPSS 1.1% estimated probability of exploitation activity in the next 30 days. Fixed in composer/composer 2.2.27, 2.9.6.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:Hcomposer/composer (Packagist): fixed in 2.9.6, 2.2.27Explain CVE-2026-40176 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-40176?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-40176?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-40176 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.
From the NVD's CPE matches.
| Product | Affected |
|---|---|
| getcomposer:composer | from 1.0.0 through 2.2.26 |
| getcomposer:composer | from 2.3.0 through 2.9.5 |
| Advisory | Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|---|
| GHSA-wg36-wvj6-r67p | Packagist | composer/composer | >=2.3.0 <2.9.6 | 2.9.6 |
| GHSA-wg36-wvj6-r67p | Packagist | composer/composer | >=1.0.0 <2.2.27 | 2.2.27 |
| Distribution | Release | Package | Fixed in | Advisory |
|---|---|---|---|---|
| Debian | 12 | composer | 2.5.5-1+deb12u4 | DEBIAN-CVE-2026-40176 |
| Debian | 13 | composer | 2.8.8-1+deb13u2 | DEBIAN-CVE-2026-40176 |
| Debian | 14 | composer | 2.9.7-1 | DEBIAN-CVE-2026-40176 |
| Ubuntu | 25.10, 26.04:LTS, 26.10 and 5 more | composer | no fix listed | UBUNTU-CVE-2026-40176 |
| Red Hat | hummingbird:1 | composer | 0:2.9.7-1.hum1 | RHSA-2026:8165 |
| SUSE | Linux Enterprise Module for Web and Scripting 15 SP7, Linux Enterprise Server 15 SP6-LTSS, Linux Enterprise Server for SAP Applications 15 SP6 | php-composer2 | 2.6.4-150600.3.12.1 | SUSE-SU-2026:3105-1 |
| SUSE | Linux Enterprise Server 16.0, Linux Enterprise Server for SAP applications 16.0 | php-composer2 | 2.8.9-160000.4.1 | SUSE-SU-2026:23116-1 SUSE-SU-2026:23138-1 |
| openSUSE | Leap 16.0 | php-composer2 | 2.8.9-160000.4.1 | openSUSE-SU-2026:21520-1 |
| openSUSE | Tumbleweed | php-composer2 | 2.9.7-1.1 | openSUSE-SU-2026:10643-1 |
| Alpine | v3.23, v3.24 | composer | 2.9.6-r0 | ALPINE-CVE-2026-40176 |
From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.
Red Hat rates this Important.
To exploit this vulnerability, a user needs to run Composer commands on untrusted projects with attacker-supplied composer.json files. VCS repositories are only loaded from the root composer.json or the composer config directory, so this issue cannot be exploited through composer.json files of packages installed as dependencies. This issue can cause arbitrary command execution but it is limited to the context of the user running Composer. Due to these reasons, this flaw has been rated with an important severity.
To mitigate this vulnerability, only run Composer commands on projects from trusted sources. Also, inspect composer.json files before running Composer commands on them, specifically checking that Perforce-related fields contain valid values.
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Hardened Images | composer-main-2.9.7-1.hum1 | Fixed 2026-04-14 | RHSA-2026:8165 |
Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-40176.
Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.
The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-20 (51).