OS Command Injection in composer - CVE-2026-40261
Published: April 14, 2026
Vulnerability details
The vulnerability allows a remote attacker to execute arbitrary commands.
The vulnerability exists due to command injection in the Perforce::syncCodeBase() and Perforce::generateP4Command() methods when processing package metadata containing a crafted Perforce source reference or source url. A remote attacker can supply a malicious package through a Composer repository to execute arbitrary commands.
The issue is exploitable when installing or updating dependencies from source, including with --prefer-source and by default for dev prefixed versions. User interaction is required to install or update the dependency.
Affected software
SUSE Linux Enterprise Server 15 SP6
SUSE Linux Enterprise Server for SAP Applications 15
SUSE Linux Enterprise Server 15
Fedora
Web and Scripting Module
openSUSE Leap
Anolis OS
php-composer2
composer
composer-doc
How to mitigate CVE-2026-40261
php-composer2 - addressed in versions 2.6.4-150600.3.9.1, 2.6.4-150600.3.12.1
composer - update to 2.9.7-1
composer-doc - update to 2.9.7-1
composer - addressed in versions 2.9.7-1.el9, 2.9.7-1.el10_1, 2.9.7-1.el10_2, 2.9.7-1.el10_3, 2.9.7-1.fc42, 2.9.7-1.fc43, 2.9.7-1.fc44
External References
Related Security Bulletins
- Multiple vulnerabilities in composer
- Fedora EPEL 10.1 update for composer
- Fedora EPEL 10.2 update for composer
- Fedora 42 update for composer
- Fedora 43 update for composer
- Fedora EPEL 10.3 update for composer
- Fedora EPEL 9 update for composer
- Fedora 44 update for composer
- Anolis OS update for composer
- SUSE update for php-composer2
- SUSE update for php-composer2