Impact
Composer, the PHP dependency manager, has a command injection flaw in the Perforce::syncCodeBase() and Perforce::generateP4Command() methods. The library appends a user‑supplied source reference and connection parameters directly into shell commands without escaping. An attacker can therefore inject arbitrary shell commands through crafted metadata fields in a Composer repository, even if Perforce is not installed. This vulnerability affects package installation and updating, including the default handling of dev‑prefixed versions, and allows an attacker who controls the package metadata to execute arbitrary code on the host system.
Affected Systems
Vulnerable Composer releases include versions 1.0 through 2.2.26 and 2.3 through 2.9.5. The issue is fixed in Composer 2.2.27 (LTS) and 2.9.6 (mainline).
Risk and Exploitability
The CVSS score of 8.8 signals a high‑severity flaw. Exploitation requires only that a malicious or compromised Composer repository is used; no additional software needs to be present. The vulnerability is actively exploitable during normal dependency installation, making it a direct and realistic threat in environments that rely on untrusted repositories or public packages.
OpenCVE Enrichment
Github GHSA