CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-84361

CVE-2026-84361: Remote Code Execution in Composer Perforce VCS Driver

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 9, 2026·6 min read·5 visits

Executive Summary (TL;DR)

Unauthenticated remote command execution in Composer's Perforce VCS driver via malicious repository configurations or lock files.

A critical remote code execution vulnerability exists in the Composer PHP dependency manager due to improper neutralization of command parameters passed to the Perforce CLI client. Unauthenticated attackers can exploit this flaw via crafted package metadata in custom repositories or lock files, triggering arbitrary OS command execution when a user or automated CI/CD pipeline runs Composer commands.

Vulnerability Overview

Composer is the standard dependency manager for the PHP ecosystem, responsible for fetching, resolving, and installing package dependencies. To support diverse version control systems, Composer includes dedicated VCS drivers, including one for Perforce. This Perforce driver allows Composer to pull package sources directly from Perforce repositories.

The vulnerability, designated as CVE-2026-84361, is classified under CWE-78 (OS Command Injection). It arises because Composer's Perforce utility fails to sanitize or restrict the package-defined source URL before passing it to the local Perforce command-line client (p4). When a package configuration defines a Perforce source type, its URL is directly mapped to the P4PORT configuration parameter.

An attacker can abuse this behavior by crafting a repository configuration or a composer.lock file containing a malicious URL prefixed with rsh: or jsh:. If the system running Composer has the p4 CLI client installed, standard actions like composer install or composer update will automatically execute local shell commands embedded in the URL.

Root Cause Analysis

The root cause of CVE-2026-84361 lies in the underlying behavior of the Perforce CLI client (p4) in conjunction with Composer's unchecked parameter forwarding. To establish a connection with a Perforce server, the p4 client relies on the endpoint address specified via the P4PORT variable or the -p parameter. By default, this address represents a network location, such as a TCP or SSL socket.

However, Perforce natively supports alternative transport protocols for advanced scripting and tunneling configurations, specifically rsh: and jsh:. When the P4PORT parameter begins with these transport prefixes, the p4 executable does not connect over the network. Instead, it spawns the remainder of the parameter string as a local subprocess and pipes standard input/output through it to communicate.

In vulnerable versions of Composer, the Composer\\Util\\Perforce class processes package-defined URLs without validating their protocol scheme. When checking if a server exists or cloning a repository, Composer invokes p4 via a subprocess executor, passing the untrusted URL as the -p argument. Because this execution is a native feature of the p4 binary, traditional argument escaping or shell sanitization routines are ineffective. The command is not executed via a shell wrapper but is launched directly by the compiled p4 executable itself.

Code Analysis

To understand the vulnerable path, we can examine how Composer handles Perforce URLs during repository verification. In vulnerable versions, the Perforce::checkServerExists() method executed a connection probe without verifying the format of the $url variable:

public static function checkServerExists(string $url, ProcessExecutor $processExecutor): bool
{
    // Vulnerable: The $url parameter is passed directly to the p4 client via -p
    return 0 === $processExecutor->execute(['p4', '-p', $url, 'info', '-s'], $ignoredOutput);
}

The corresponding patch introduces a strict validation helper isValidPort() in src/Composer/Util/Perforce.php to filter out non-network endpoints before they reach the executable:

public static function isValidPort(string $url): bool
{
    // Reject any transport keywords like rsh or jsh to prevent local subprocess execution
    if (Preg::isMatch('{^\\s*+(?:rsh|jsh)\\s*+:}i', $url)) {
        return false;
    }
 
    // Enforce strict whitelist of allowed tcp/ssl socket patterns
    return Preg::isMatch('{^(?:(?:tcp|ssl)(?:4|6|46|64)?:)?(?:\\\\[[0-9a-f:.]++\\\\]|[a-z0-9._][a-z0-9._-]*+)(?::[a-z0-9._][a-z0-9._-]*+)?$}iD', $url);
}

Additionally, this validation check is called during package loading inside ValidatingArrayLoader.php to catch unsafe URLs early and throw a SecurityException. The use of the /D modifier in the regular expression prevents newline injection attacks, ensuring complete remediation of the parameter parsing logic.

Exploitation Methodology

Exploitation of CVE-2026-84361 is straightforward if the victim's environment meets the prerequisites. The primary requirements are that the Perforce p4 command-line client is installed and accessible on the system's PATH, and the target executes a dependency resolution command on an untrusted configuration.

An attacker can trigger this vulnerability by publishing a malicious dependency within a custom package repository or by submitting a compromised composer.lock file to a repository. Below is an example of a malicious composer.json block that specifies a perforce repository type with an embedded command:

{
  "type": "package",
  "package": {
    "name": "poc/perforce-source",
    "version": "1.0.0",
    "source": {
      "type": "perforce",
      "url": "rsh:touch /tmp/cve-2026-84361-composer-marker",
      "reference": "//depot/main"
    }
  }
}

When a developer or a continuous integration (CI) runner executes composer install or composer update --prefer-source, Composer parses this package definition. It attempts to verify the Perforce repository by executing p4 -p rsh:touch /tmp/... info -s. The p4 binary parses the rsh: transport scheme, spawns the sub-command, and triggers arbitrary command execution under the user's privilege level.

Impact Assessment

The impact of successful exploitation is critical, leading to full Remote Code Execution (RCE) on the host machine running Composer. In development environments, this grants the attacker access to local source code, environment variables, SSH keys, and local credentials.

In modern software engineering workflows, the impact on CI/CD pipelines is especially high. Automated systems frequently execute Composer commands as part of building, testing, or deploying applications. If a pipeline processes an untrusted pull request containing a malicious composer.lock file, the attacker can execute arbitrary commands on the build agent.

This execution can lead to compromised build artifacts, leaked cloud provider credentials, or secondary supply chain attacks if the build runner possesses write permissions to other repositories or container registries. The CVSS score of 7.7 reflects this risk, although the requirement for the p4 binary to be present on the host somewhat limits the default attack surface.

Remediation and Patches

The primary and most effective remediation is upgrading Composer to a patched release. For legacy installations, the vulnerability is fixed in version 2.2.30. For modern environments, upgrading to 2.10.3 or later eliminates the flaw entirely.

If upgrading Composer is not immediately feasible, organizations should apply defensive mitigations to break the exploit chain. Since the exploit depends on the presence of the p4 command-line utility, removing the p4 binary from systems that do not use Perforce completely neutralizes the threat.

Additionally, team leads and security engineers should implement strict validation controls on package registries. Because Packagist.org does not permit Perforce source metadata, default public packages are safe. However, organizations hosting private registries should enforce schema validation to block the ingestion of any package containing a perforce source type with an unvalidated connection string.

Fix Analysis (2)

Technical Appendix

CVSS Score
7.7/ 10
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
EPSS Probability
0.41%
Top 66% most exploited

Affected Systems

Composer < 2.2.30Composer 2.3.x to < 2.10.3

Affected Versions Detail

Product
Affected Versions
Fixed Version
Composer
Composer Project
>= 1.0, < 2.2.302.2.30
Composer
Composer Project
>= 2.3.0, < 2.10.32.10.3
AttributeDetail
CWE IDCWE-78
Attack VectorNetwork
CVSS Score7.7
EPSS Score0.00409
ImpactRemote Code Execution (RCE)
Exploit StatusProof-of-Concept (PoC) available
KEV StatusNot listed

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

The software constructs an OS command using externally-influenced input, but it does not neutralize or incorrectly neutralize special elements that can modify the intended OS command when it is sent to a downstream component.

Known Exploits & Detection

GitHubAuthorized-testing PoC repository with simulation script and malicious composer.json setup

Vulnerability Timeline

Patches developed and merged into Composer code branches
2026-08-27
GitHub Security Advisory published and patched versions released
2026-09-01
Public Proof-of-Concept repository published on GitHub
2026-09-02
Vulnerability recorded in EPSS scoring indices
2026-09-08

References & Sources

  • [1]GitHub Security Advisory GHSA-rvx4-ffvw-m9q3
  • [2]Composer Fix Commit (0aac505)
  • [3]Composer Fix Commit (199ad81)
  • [4]Composer Release 2.10.3
  • [5]Composer Release 2.2.30
  • [6]Saku0512 Proof of Concept Repository
  • [7]PoC README
  • [8]PoC composer.json
  • [9]PoC php simulation script

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 3 hours ago•CVE-2026-84376
6.3

CVE-2026-84376: Authorization Bypass via Missing Path-Segment Boundary Validation in Astro

An authorization bypass vulnerability exists in the Astro web framework prior to version 7.2.4. When configured with a non-root base path, Astro's routing engine stripped the base path from incoming request URLs using an insecure prefix-match check without verifying path-segment boundaries. This created a path parser differential between user-defined middleware and the internal router. An unauthenticated attacker could bypass route-based authorization checks to access administrative or privileged endpoints by altering the path prefix segment.

Alon Barad
Alon Barad
3 views•6 min read
•about 4 hours ago•GHSA-26W7-CXV4-GFX2
9.8

GHSA-26W7-CXV4-GFX2: Remote Code Execution in Astro via Outdated Sharp Native Dependency

A critical remote code execution vulnerability in Astro's image optimization pipeline allows unauthenticated attackers to trigger memory corruption via malformed AVIF images, due to outdated native dependencies in the sharp package.

Alon Barad
Alon Barad
5 views•7 min read
•about 6 hours ago•CVE-2026-81525
8.6

CVE-2026-81525: Cross-Tenant Database Retargeting via Dot and Null Injection in MongoDB PHP Driver

A high-severity namespace injection vulnerability in both the MongoDB Client Library for PHP (mongodb/mongodb) and the native PHP C Extension (ext-mongodb) allows unauthenticated remote attackers to bypass logical database separation and execute database commands inside unauthorized storage compartments via dot (".") and null byte ("\0") injection.

Alon Barad
Alon Barad
6 views•7 min read
•about 7 hours ago•CVE-2026-84452
8.6

CVE-2026-84452: Localhost Remote Code Execution via CORS Misconfiguration in Windows ML CLI

A critical vulnerability (CVE-2026-84452) in the Windows ML CLI (winml-cli) HTTP server component allows unauthenticated remote code execution via permissive CORS and lack of request validation.

Alon Barad
Alon Barad
7 views•7 min read
•about 8 hours ago•CVE-2026-15603
5.3

CVE-2026-15603: Log Forging via Unescaped Unicode Line Separators in morgan Middleware

An incomplete fix vulnerability (CVE-2026-15603) in the morgan HTTP request logger middleware for Node.js allows unauthenticated remote attackers to forge log entries. The flaw arises because the escaping mechanism does not neutralize Unicode line separator characters, enabling attackers to inject payloads that trick downstream log processors into splitting single log records into multiple logical entries.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 10 hours ago•CVE-2026-82333
7.5

CVE-2026-82333: Remote Denial of Service via Sparse Array Manipulation in Multer

A high-severity denial of service vulnerability in the Node.js middleware 'multer' allows unauthenticated remote attackers to exhaust CPU resources and freeze applications. By submitting small, specially crafted 'multipart/form-data' requests containing large array indices alongside conflicting parameter keys, attackers force synchronous execution loops over up to 4.2 billion elements within the underlying 'append-field' library.

Amit Schendel
Amit Schendel
11 views•7 min read