Summary
Composer arbitrary command execution via a malicious package's Perforce source URL
If the p4 Perforce CLI client is installed, a malicious dependency package from a package repository allowing arbitrary perforce source URLs (packagist.org is safe) could execute arbitrary commands when running composer install or composer update. Composer passed a package's Perforce source address to the p4 CLI client without validating it. The p4 CLI client accepts addresses that mean "run this local command" instead of "connect to this server". This is remote code execution with the privileges of the user or CI account running Composer.
Am I affected?
You are only affected if all of the following are true:
- The Perforce
p4command line client is installed and on thePATHof the machine running Composer. - An attacker can control a package metadata's
sourcesection with a perforce type. Packagist.org does not allow perforce source metadata, so you are only exploitable if you rely on another Composer repository (any customcomposer-type repository, or an inlinepackagerepository entry), or acomposer.lockfile you obtained from somewhere you do not trust. - The package gets installed from source, either because it has no dist artifact or because source installs are selected (for example
--prefer-source).
Plainly not affected: anyone without the p4 client installed, which is the large majority of Composer users. Perforce is an optional VCS integration. Also not affected: projects that only consume packages from Packagist.org, which does not allow Perforce source repositories and therefore cannot serve a package with a Perforce source address.
Most realistic way to get hit: a developer workstation or CI image that has Perforce tooling installed, pulling packages from a private or third party Composer repository that an attacker has compromised.
Patched versions
Composer now validates Perforce source addresses before handing them to the p4 client, and accepts only real network endpoints (an optional tcp/ssl transport with a host and port). Addresses that make the client spawn a local process are rejected, and the package fails validation on both update and install, before any p4 command runs. Fixed in Composer 2.10.3 and 2.2.30.
Note: If you legitimately use Perforce with an unusual P4PORT value that is not a plain host and port, Composer will now reject it.
Workarounds
Upgrading is the only complete fix.
Risk reduction short of upgrading:
- Remove the
p4client from thePATHof machines that run Composer but do not use Perforce. This fully blocks this specific attack, since the vulnerability depends on that client being present. - Restrict configured repositories to sources you control or trust, and treat lock files from untrusted sources as untrusted input.
Impact
Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
composer/composer to 2.10.3 or later; composer/composer to 2.2.30 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-84361? CVE-2026-84361 is a high-severity OS command injection vulnerability in composer/composer (composer), affecting versions >= 2.3.0, < 2.10.3. It is fixed in 2.10.3, 2.2.30. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
- Which versions of composer/composer are affected by CVE-2026-84361? composer/composer (composer) versions >= 2.3.0, < 2.10.3 is affected.
- Is there a fix for CVE-2026-84361? Yes. CVE-2026-84361 is fixed in 2.10.3, 2.2.30. Upgrade to this version or later.
- Is CVE-2026-84361 exploitable, and should I be worried? Whether CVE-2026-84361 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-84361 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-84361?
- Upgrade
composer/composerto 2.10.3 or later - Upgrade
composer/composerto 2.2.30 or later
- Upgrade