ZeroHour

CVE-2026-84361

large

Command Injection in Composer via Malicious Perforce Source URLs

CVSS 4.0
7.7 high
EPSS
<1%p34
Published
()
Modified
AI analysis

Composer handed a package's Perforce source address to the p4 CLI client without validating it, and p4 interprets certain address strings as 'run this local command' rather than 'connect to this server', enabling OS command injection (CWE-78). It is triggered during `composer install` or `composer update` when three conditions hold: the p4 client is installed and on PATH, the package's perforce-type source metadata comes from a repository the attacker controls or influenced (Packagist.org disallows perforce source metadata, so it is not a vector), and the package is installed from source, e.g. via --prefer-source or a missing dist artifact, including from an untrusted composer.lock. An attacker gains arbitrary command execution with the privileges of the developer or CI account running Composer. Only environments with Perforce tooling present and non-Packagist repository sources are affected, which the advisory describes as a small minority of Composer users. No public proof-of-concept, CISA KEV listing, or known exploitation exists; EPSS is 0.4% and fixes are available in Composer 2.10.3 and 2.2.30.

What to do: Upgrade to Composer 2.10.3 (or 2.2.30 on the 2.2 branch); note that legitimate non-standard P4PORT values will now be rejected. Until upgraded, remove the p4 client from the PATH of Composer/CI machines that do not use Perforce — this fully blocks the attack — and restrict configured repositories to trusted sources, treating composer.lock files from untrusted origins as untrusted input. Audit developer workstations and CI images for the presence of p4 to gauge exposure.

Affected
Composer Project (Packagist) Composer2.x prior to 2.10.3 and the 2.2.x line prior to 2.2.30; exploitable only when the Perforce p4 client is on PATH and packages come from a non-Packagist repositor
Estimated exposure
large≈100,000–1,000,000 developer and CI environments (a small minority of Composer's multi-million-user base that also has the Perforce p4 client installed) — Composer runs in millions of PHP projects and CI pipelines, but the advisory states the large majority of users lack the p4 client, so the vulnerable intersection is plausibly on the order of hundreds of thousands of machines — an…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

Composer is a dependency Manager for the PHP language. From 1.0 until 2.2.30 and 2.10.3, a malicious dependency package from a custom Composer repository or an untrusted composer.lock file could set source.type to perforce and source.url to an rsh: or jsh: P4PORT value. When the Perforce p4 client was installed and Composer installed the package from source through composer install or composer update, including --prefer-source, Composer\Util\Perforce passed the address to p4 without validation, causing p4 to run a local command with the privileges of the user or CI account. Packagist.org does not permit Perforce source metadata. This issue is fixed in versions 2.2.30 and 2.10.3.

Ecosystems
composer
Weakness
CWE-78
Vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
GHSA
GHSA-rvx4-ffvw-m9q3 (high)

In the news

No ingested article mentions this CVE yet.