GHSA-rvx4-ffvw-m9q3: OS Command Injection

Published Sep 8, 2026
·
Updated

Summary

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 p4 command line client is installed and on the PATH of the machine running Composer. - An attacker can control a package metadata's source section 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 custom composer-type repository, or an inline package repository entry), or a composer.lock file 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 p4 client from the PATH of 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.

Affected Software

2 affected componentsFixes available
composer/composer/composer>=1.0<2.2.30
2.2.30
composer/composer/composer>=2.3.0<2.10.3
2.10.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/composer/composer to a version that resolves this vulnerability.

    Fixed in 2.2.30
  2. Upgrade

    Upgrade composer/composer/composer to a version that resolves this vulnerability.

    Fixed in 2.10.3
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.10.3
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.2.30
  5. Configuration

    Restrict configured Composer repositories to sources you control or trust, and treat `composer.lock` files from untrusted sources as untrusted input.

    Composer repositories sources trust = Restrict configured repositories to sources you control or trust; treat lock files from untrusted sources as untrusted input.
  6. Compensating control

    Remove the `p4` client from the `PATH` of machines that run Composer but do not use Perforce.

Event History

Sep 8, 2026
Advisory Published
via GitHub·09:25 PM
Data Sourced
via GitHub·09:25 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Are projects using only Packagist.org exposed?

No. Packagist.org does not allow Perforce source metadata. Exposure requires another Composer repository that permits attacker-controlled Perforce source metadata, an inline package repository entry, or an untrusted composer.lock file.

2

What conditions are required for exploitation?

The p4 Perforce CLI client must be installed and available on PATH where Composer runs. A package with attacker-controlled perforce source metadata must also be installed from source, either because no dist artifact exists or because source installation is selected.

3

What access does successful exploitation provide?

A malicious Perforce source address can cause arbitrary commands to run with the privileges of the user or CI account executing composer install or composer update.

4

How can I assess whether an environment is affected?

Check whether p4 is available on PATH for Composer users and CI runners, and review configured Composer repositories and composer.lock provenance. Focus on custom composer-type repositories, inline package repositories, and lock files obtained from untrusted sources, particularly where packages are installed from source.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203