
Proof-of-concept for CVE-2026-84361, demonstrating command injection in Composer's Perforce driver via malicious P4PORT, with Docker-based verification and mitigation guidance.
Docker Compose provides an isolated image containing vulnerable Composer 2.10.2 and the Perforce p4 client. At runtime it has no network, a read-only root filesystem, no Linux capabilities, and writable tmpfs mounts only at /tmp and /work.
# Build; the official p4 download is verified against its SHA-256 manifest.
docker compose build
# Directly demonstrate p4 handling the rsh: P4PORT (default).
docker compose run --rm poc
# Demonstrate the vulnerable Composer path.
docker compose run --rm poc /usr/local/bin/run-composer-poc.sh
The Composer test intentionally uses a marker command, not a Perforce server. Composer may therefore report an installation error after the marker runs; the wrapper reports [+] VULNERABLE and exits successfully when it confirms the marker.
This is a local Proof of Concept (PoC) for CVE-2026-84361, an arbitrary-command-execution vulnerability in Composer's Perforce VCS driver.
Affected Composer versions pass a package-controlled Perforce source.url to p4 as P4PORT. The p4 client treats rsh: and jsh: P4PORT values as a local command instead of a network endpoint. Consequently, an attacker-controlled package metadata entry or lock file can execute a command as the user or CI account running Composer when the package is installed from source.
This PoC only creates an empty marker file in the system temporary directory.
Discovered by: saku0512 (GitHub)
Use only for education and authorized security testing. Do not run this on systems or CI environments without explicit permission.
>= 1.0, < 2.2.30 and >= 2.3.0, < 2.10.3Exploitation requires p4 on PATH, attacker-controlled Perforce source metadata (or an untrusted lock file), and a source installation. Packagist.org does not allow Perforce source metadata, so Packagist-only workflows are not affected.
# Safe dry-run: does not start p4
php poc.php
# Run only in an authorized isolated environment
php poc.php --execute
# Reproduce through vulnerable Composer in an isolated environment
composer update --prefer-source
--execute uses a harmless marker payload and removes it by default. Add --keep-marker to retain it for inspection. Patched Composer rejects the invalid Perforce source URL before starting p4.
Upgrade Composer to 2.2.30 or 2.10.3 or later. Use only trusted repositories and lock files, and remove p4 from PATH where Perforce support is not needed.