CVE-2026-40261 — Vulnerability in composer/composer — CVE Details
Composer has a command injection via malicious perforce reference
Summary
Advisory Timeline
- First published April 14, 2026 (181 days ago).
- Last revised September 10, 2026 — 148 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
composer require "composer/composer:^2.9.6"
composer require "composer/composer:^2.2.27"
After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: packagist (1).
| Package | Ecosystem | Affected | Fixed In |
|---|---|---|---|
| composer/composer | packagist | 2.3.0, 2.3.1, 2.3.10, 2.3.2 (+59 more) | 2.9.6 |
| composer/composer | packagist | 1.0.0, 1.0.1, 1.0.2, 1.0.3 (+143 more) | 2.2.27 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
References
- https://github.com/composer/composer/security/advisories/GHSA-gqw4-4w2p-838qWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-40261ADVISORY
- https://access.redhat.com/errata/RHSA-2026:8165WEB
- https://access.redhat.com/security/cve/CVE-2026-40261WEB
- https://bugzilla.redhat.com/show_bug.cgi?id=2458841WEB
- https://github.com/FriendsOfPHP/security-advisories/blob/master/composer/composer/CVE-2026-40261.yamlWEB
- https://github.com/composer/composerPACKAGE
- https://github.com/composer/composer/releases/tag/2.9.6WEB
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40261.jsonWEB
Frequently Asked Questions
- What is CVE-2026-40261?
- Composer has a command injection via malicious perforce reference This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
- How do I check if my project is affected by CVE-2026-40261?
- CVE-2026-40261 affects composer/composer. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-40261 and 200,000+ other known vulnerabilities.
Severity & Exploitability
High exploitability or significant impact. Prioritize remediation within days.
Also Known As
Related CVEs
- CVE-2024-35241HIGH
Composer has a command injection via malicious git branch name
- CVE-2026-65954HIGH
PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()
- CVE-2026-84361HIGH
Composer arbitrary command execution via a malicious package's Perforce source URL
- CVE-2024-35242HIGH
Composer has multiple command injections via malicious git/hg branch names
- CVE-2026-61825HIGH
code16/sharp has a stored XSS via data-html-content Sanitizer Bypass
Check if you're affected
Scan your dependencies to see if this vulnerability affects your projects.
Scan Your Dependencies