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::syncCodeBase() method, which appends the $sourceReference parameter to a shell command without proper escaping, and additionally in the Perforce::generateP4Command() method as in GHSA-wg36-wvj6-r67p / CVE-2026-40176, which interpolates user-supplied Perforce connection parameters (port, user, client) from the source url field without proper escaping. An attacker can inject arbitrary commands through crafted source reference or source url values containing shell metacharacters, even if Perforce is not installed. Unlike CVE-2026-40176, the source reference and url are provided as part of package metadata, meaning any compromised or malicious Composer repository can serve package metadata declaring perforce as a source type with malicious values. This vulnerability is exploitable when installing or updating dependencies from source, including the default behavior when installing dev-prefixed versions. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline). If developers are unable to immediately update, they can avoid installing dependencies from source by using --prefer-dist or the preferred-install: dist config setting, and only use trusted Composer repositories as a workaround.
CVE-2026-40261
This high-severity CVE scores 8.8 under NVD CVSS v3. EPSS exploit probability: 0.0%, top 87% of all CVEs by exploit prediction. GitHub Security Advisory data not yet ingested — confidence will rise once GHSA publishes (typical lag: hours to days for open-source ecosystem CVEs; never for infrastructure-only CVEs).
- High severity, but no confirmed exploitation yet
A fix is available — apply it.
- CVSS v3
- 8.8
- EG Score
- 8.8(medium)
- EPSS
- 74.4%
- KEV
- Not listed
Published
April 15, 2026
Last Modified
July 15, 2026
Advisory Details (2)
Auto-updated May 2, 2026Command injection via malicious Perforce source reference/url · Advisory · composer/composer · GitHub
https://github.com/composer/composer/security/advisories/GHSA-gqw4-4w2p-838qRelease 2.9.6 · composer/composer · GitHub
https://github.com/composer/composer/releases/tag/2.9.6Vendor Advisories for CVE-2026-40261(1)
These vendors published their own advisory mentioning this CVE — often with vendor-specific remediation steps + affected product lists not in NVD.
Patch Availability(1)
| Vendor / Ecosystem | Fixed in / Patch | Released | Source |
|---|---|---|---|
| redhat | composer-main-2.9.7-1.hum1 | 2026-04-14 | redhat |
Patches are aggregated from vendor advisories (Red Hat, Microsoft, Cisco, GitHub) and package ecosystems (OSV, GHSA). Multiple rows for the same upstream release have been deduplicated.
Affected Packages
(1 across 1 ecosystem)
Packagist(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| composer/composer | 1.0.0 ... 2.2.9 (146 versions) | 2.2.27 | — |
Weakness Classification(2)
MITRE Common Weakness Enumeration — the root-cause categories this CVE belongs to.
Data Freshness Timeline
(refreshed 9× in last 7d / 37× in last 30d)
Each row is a source pipeline that fetched or updated this CVE on that date, with what changed. For example, "NVD update" means NVD published or revised its analysis for this CVE; "MITRE cvelistV5" means we ingested or refreshed it from the CNA feed. Most recent first.
Showing the most recent 100 of 109 total refreshes for this CVE.
- 2026-07-15 16:57 UTCEPSS rescore
- 2026-07-15 16:57 UTCEPSS rescore
- 2026-07-15 02:00 UTCEPSS rescore
- 2026-07-13 22:30 UTCEPSS rescore
- 2026-07-13 06:13 UTCEPSS rescore
- 2026-07-13 06:13 UTCEPSS rescore
- 2026-07-12 05:46 UTCEPSS rescore
- 2026-07-11 08:27 UTCEPSS rescore
- 2026-07-09 19:10 UTCEPSS rescore
- 2026-07-08 15:15 UTCEPSS rescore
- 2026-07-07 13:46 UTCEPSS rescore
- 2026-07-06 16:27 UTCEPSS rescore
- 2026-07-06 16:27 UTCEPSS rescore
- 2026-07-06 02:23 UTCEPSS rescore
- 2026-07-06 02:23 UTCEPSS rescore
- 2026-07-05 02:30 UTCEPSS rescore
- 2026-07-04 06:31 UTCEPSS rescore
- 2026-07-01 15:06 UTCEPSS rescore
- 2026-06-30 23:22 UTCEPSS rescore
- 2026-06-29 14:06 UTCEPSS rescore
- 2026-06-28 14:07 UTCEPSS rescore
- 2026-06-28 04:56 UTCEPSS rescore
- 2026-06-27 03:08 UTCEPSS rescore
- 2026-06-25 13:49 UTCEPSS rescore
- 2026-06-25 13:49 UTCEPSS rescore
Show 75 moreShow fewer
- 2026-06-24 14:05 UTCEPSS rescore
- 2026-06-23 21:33 UTCEPSS rescore
- 2026-06-22 14:25 UTCEPSS rescore
- 2026-06-22 14:25 UTCEPSS rescore
- 2026-06-21 14:56 UTCEPSS rescore
- 2026-06-21 14:56 UTCEPSS rescore
- 2026-06-21 01:59 UTCEPSS rescore
- 2026-06-19 19:25 UTCEPSS rescore
- 2026-06-18 17:52 UTCEPSS rescore
- 2026-06-18 17:52 UTCEPSS rescore
- 2026-06-17 17:53 UTCEPSS rescore
- 2026-06-16 17:52 UTCEPSS rescore
- 2026-06-15 17:49 UTCEPSS rescore
- 2026-06-14 20:40 UTCEG score recompute
- 2026-06-14 20:40 UTCVendor advisory
- 2026-06-13 23:00 UTCEPSS rescore
- 2026-06-12 23:12 UTCEPSS rescore
- 2026-06-12 23:12 UTCEPSS rescore
- 2026-06-12 06:24 UTCEG score recompute
- 2026-06-12 06:24 UTCVendor advisory
- 2026-06-11 18:58 UTCEG score recompute
- 2026-06-11 18:58 UTCVendor advisory
- 2026-06-11 14:00 UTCEPSS rescore
- 2026-06-10 23:11 UTCEG score recompute
- 2026-06-10 23:11 UTCVendor advisory
- 2026-06-10 22:18 UTCEPSS rescore
- 2026-06-10 13:22 UTCEPSS rescore
- 2026-06-10 13:22 UTCEPSS rescore
- 2026-06-10 11:47 UTCEG score recompute
- 2026-06-10 11:47 UTCVendor advisory
- 2026-06-10 00:24 UTCEG score recompute
- 2026-06-10 00:24 UTCVendor advisory
- 2026-06-09 10:10 UTCEG score recompute
- 2026-06-09 10:10 UTCVendor advisory
- 2026-06-08 14:17 UTCEPSS rescore
- 2026-06-08 14:17 UTCEPSS rescore
- 2026-06-08 03:52 UTCEG score recompute
- 2026-06-08 03:52 UTCVendor advisory
- 2026-06-07 16:29 UTCEG score recompute
- 2026-06-07 16:29 UTCVendor advisory
- 2026-06-07 15:25 UTCEPSS rescore
- 2026-06-07 15:25 UTCEPSS rescore
- 2026-06-07 05:06 UTCEG score recompute
- 2026-06-07 05:06 UTCVendor advisory
- 2026-06-06 13:47 UTCEPSS rescore
- 2026-06-06 13:47 UTCEPSS rescore
- 2026-06-05 22:47 UTCEPSS rescore
- 2026-06-05 06:10 UTCEPSS rescore
- 2026-06-05 06:10 UTCEPSS rescore
- 2026-06-04 13:12 UTCEPSS rescore
- 2026-06-04 13:12 UTCEPSS rescore
- 2026-06-03 18:52 UTCEG score recompute
- 2026-06-03 18:52 UTCVendor advisory
- 2026-06-02 20:13 UTCEPSS rescore
- 2026-06-02 14:25 UTCEG score recompute
- 2026-06-02 14:25 UTCVendor advisory
- 2026-06-01 18:29 UTCEG score recompute
- 2026-06-01 18:29 UTCVendor advisory
- 2026-06-01 13:52 UTCEPSS rescore
- 2026-06-01 13:52 UTCEPSS rescore
- 2026-06-01 13:51 UTCEPSS rescore
- 2026-05-31 22:30 UTCEPSS rescore
- 2026-05-31 22:30 UTCEPSS rescore
- 2026-05-31 00:16 UTCEPSS rescore
- 2026-05-31 00:16 UTCEPSS rescore
- 2026-05-31 00:16 UTCEPSS rescore
- 2026-05-29 13:44 UTCEPSS rescore
- 2026-05-29 13:44 UTCEPSS rescore
- 2026-05-28 13:44 UTCEPSS rescore
- 2026-05-28 13:44 UTCEPSS rescore
- 2026-05-28 13:44 UTCEPSS rescore
- 2026-05-27 13:40 UTCEPSS rescore
- 2026-05-27 13:40 UTCEPSS rescore
- 2026-05-27 13:40 UTCEPSS rescore
- 2026-05-26 13:44 UTCEPSS rescore
Related CVEs(same vendor + same CWE)
Same vendor
10 shownredhat
Same CWE
10 shownCWE-20 · CWE-78
- CVE-2002-2444EG 9.8CRITICAL
- CVE-1999-0043EG 9.8EPSS 99%CRITICAL
- CVE-2002-1359NVD 0.0EG 9.0EPSS 100%NONE
- CVE-2002-0061NVD 0.0EG 9.0EPSS 99%NONE
- CVE-2000-0380NVD 0.0EG 9.0EPSS 98%NONE
- CVE-1999-0067NVD 0.0EG 9.0EPSS 100%NONE
- CVE-2000-0258EG 7.5EPSS 97%HIGH
- CVE-2002-2443EG 0.0EPSS 93%NONE
- CVE-2002-2433EG 0.0NONE
- CVE-2003-1569EG 0.0NONE
Frequently asked(5)
What is CVE-2026-40261?
When was CVE-2026-40261 disclosed?
Is CVE-2026-40261 actively exploited?
What is the CVSS score of CVE-2026-40261?
How do I remediate CVE-2026-40261?
Dependency Blast Radius
See which npm, PyPI, Go, and Maven packages are affected by CVE-2026-40261
Is Your Infrastructure Affected by CVE-2026-40261?
EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.