Skip to main content
Mallory
← Back to News
open-source-dependency-vulnerabilitywidely-deployed-product-advisoryinitial-access-methodproof-of-concept-release

PHP Composer Perforce Flaws Allow Arbitrary Command Execution

Vulnerability Disclosure · 8 sources · Updated 5mo ago · First seen Apr 14, 2026

PHP Composer Perforce Flaws Allow Arbitrary Command Execution

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.

Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

2 events · Apr 10, 2026 – Apr 14, 2026
  1. Apr 14, 20267mo ago

    Composer discloses two command injection flaws and releases patches

    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.

  2. Apr 10, 20268mo ago

    Packagist disables Perforce metadata publishing and Composer disables Perforce VCS driver

    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.

Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →
Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.