Two high-severity vulnerabilities in PHP Composer could let attackers execute arbitrary commands through the package manager’s Perforce VCS driver. The flaws, tracked as CVE-2026-40176 and CVE-2026-40261, were caused by improper input validation and insufficient escaping when Composer built shell commands from repository configuration and source metadata. One issue can be triggered by a malicious composer.json in an untrusted root project, while the other can be exploited through a crafted source reference from a malicious or compromised repository.
The bugs affect Composer versions >= 2.3 and < 2.9.6, as well as >= 2.0 and < 2.2.27, and were patched in 2.9.6 and 2.2.27 LTS. Maintainers said injected commands could run even if Perforce is not installed on the target system. Composer, Packagist.org, and Private Packagist reported no evidence of active exploitation, but Packagist disabled publication of Perforce source metadata and the Perforce VCS driver as a precaution. Users were urged to update immediately, scrutinize composer.json files, rely only on trusted repositories, and avoid dependency installation via --prefer-dist or the preferred-install: dist setting.

Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.
2 events from the most recent confirmed update back to the earliest known activity.
Composer disclosed CVE-2026-40176 and CVE-2026-40261, two high-severity command injection vulnerabilities in its Perforce VCS handling that could enable arbitrary command execution, including in some cases where Perforce is not installed. Fixes were released in Composer versions 2.9.6 and 2.2.27 LTS, and maintainers said they found no evidence of exploitation on Packagist.org.
As a precaution on Packagist.org and Private Packagist, publication of Perforce source metadata was disabled, and the Composer Perforce VCS driver was also disabled. The action was taken on April 10, 2026, after the command injection risk was identified.
Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.
8 references tracked. Mallory keeps watching after this page renders.
scworld.com
Open sourcecybersecuritynews.com
Open sourcesecurityaffairs.com
Open sourcecvefeed.io
Open sourcethehackernews.com
Open sourceblog.packagist.com
Open sourcegithub.com
Open sourcegithub.com
Open sourceMap indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.