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-59948

CVE-2026-59948: Path Traversal and Arbitrary File Write in Composer Dependency Resolution

Alon Barad
Alon Barad
Software Engineer

Jul 20, 2026·6 min read·15 visits

Executive Summary (TL;DR)

Composer versions prior to 2.2.29 and 2.10.2 do not validate metadata from untrusted repositories during dependency resolution, permitting path traversal, arbitrary file writes outside the project directory, and argument injection.

CVE-2026-59948 is a high-severity path traversal and arbitrary file write vulnerability in the Composer dependency manager for PHP. When resolving package dependencies from custom, untrusted repositories, vulnerable versions fail to validate critical metadata like package names, source/dist URLs, and binary paths. An attacker who controls a third-party repository can serve a malicious package structure that escapes the 'vendor/' folder, enabling arbitrary file creation, option injection in VCS commands, and potential local execution.

Vulnerability Overview

Composer is the primary dependency manager for the PHP ecosystem, responsible for fetching, resolving, and installing third-party software packages and library trees. The utility is commonly integrated into developer workstations, automation scripts, and continuous integration/continuous deployment (CI/CD) pipelines. To optimize performance, the system exposes an attack surface where repository metadata is queried and loaded from external endpoints before executing local extraction.

The vulnerability classified as CVE-2026-59948 arises when Composer interfaces with configured custom or third-party repositories other than the default public indexes. If an attacker controls or compromises one of these third-party package repositories, they can return manipulated metadata during dependency resolution operations. Because the tool does not perform standard security checks on certain resolved fields at this phase, the application processes insecure parameters.

The technical impact of this vulnerability manifests primarily as path traversal (CWE-22) and out-of-bounds write (CWE-787). Successfully exploiting the vulnerability allows an attacker to write arbitrary files outside the restricted vendor directory on the target host. Additionally, associated vectors in the same transaction path enable option injection in version control command lines and directory traversal inside package executable configuration paths.

Root Cause Analysis

The root cause of CVE-2026-59948 resides in Composer's processing pipeline for remote metadata during the resolution phase. To speed up dependency resolution, the system utilizes a high-performance parser class named ArrayLoader when parsing packages returned from configured repositories. This optimization skips several critical security validation checks, such as name sanitization, directory checking, and remote source URL scanning.

When Composer receives a package definition, it processes the corresponding metadata into a local list within the dependency solver framework. In vulnerable versions, the solver transfers these resolved packages into a lock transaction via LockTransaction::setResultPackages without validating whether the package values conform to safe naming schemes. This allows a maliciously constructed package definition to specify a directory-traversing name like vendor/../../escaped-dir.

During the subsequent step of writing the lock file and extracting download archives, the installer derives local file path locations using the unsanitized package names. Since the file paths are computed by appending the unvalidated package name directly to the project root, directory traversal sequences cause the resolved target paths to point outside the intended boundaries. The extraction engine then writes the archive contents directly to these out-of-bounds file system locations.

Code Analysis

To understand the technical fix, we analyze the implementation changes introduced in the patch lifecycle. The vulnerability was mitigated by implementing a strict verification gatekeeper inside the dependency resolver layer, ensuring that package metadata is fully validated before any transactions are committed or files are written. The following diagram illustrates the validated execution flow established by the patch:

In the vulnerable codebase, the setResultPackages method in src/Composer/DependencyResolver/LockTransaction.php added packages directly from the solver pool to the result package array. The patch inserts a direct call to a newly designed validation utility before committing the package:

// src/Composer/DependencyResolver/LockTransaction.php (Patched Excerpt)
if ($literal > 0) {
    $package = $pool->literalToPackage($literal);
 
    // Re-validate the package structure before committing it to the transaction
    ValidatingArrayLoader::validatePackage($package);
 
    $this->resultPackages['all'][] = $package;
}

The core of the mitigation is implemented in src/Composer/Package/Loader/ValidatingArrayLoader.php through the static validatePackage method. This function inspects the deserialized package instance, calling hasPackageNamingError to filter out directory traversal payloads. Additionally, it audits the source/dist URLs and binary paths to ensure no parameter starts with a hyphen (blocking option injection) and that binary definitions do not contain double-dot (..) segments.

Exploitation Methodology

Exploitation of CVE-2026-59948 requires a specific pre-configuration where the victim has explicitly registered an untrusted or compromised custom package repository in their project's composer.json file. The attacker must possess administrative control over this repository or execute a man-in-the-middle (MITM) attack to manipulate the HTTP payloads served by the endpoint. Once these requirements are met, the attack proceeds entirely via the metadata transfer phase.

The attacker constructs a package definition containing directory traversal sequences in the name element. When the victim initiates dependency resolution by invoking the composer update or composer install command, Composer requests package definitions from the malicious endpoint. The tool resolves the dependency hierarchy, parses the payload with the unvalidated array loader, and inserts the traversal path directly into the transaction metadata block.

During the final installation phase, Composer downloads the corresponding distribution ZIP archive specified in the metadata and computes the destination path. Due to the directory traversal sequence, the destination path points to a folder outside of the vendor/ sandbox, such as a system directory or a user startup directory. The extraction routine executes, placing the payload files into the designated path and completing the arbitrary file write attack.

Impact Assessment

The impact of successful exploitation is severe, leading to potential local code execution (RCE) on the developer workstation or CI/CD runner. By writing arbitrary files outside the project root, an attacker can overwrite existing system utilities, inject malicious scripts into startup folders, or plant web shells in publicly accessible directories. The compromise extends to any environment executing the vulnerable dependency manager.

The CVSS v3.1 base score for this vulnerability is assessed at 7.0, indicating a high-severity vulnerability. The metric vector is evaluated as CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H. The Local (L) attack vector reflects that the execution must occur on the victim's machine, and the High (H) complexity indicates the prerequisite of targeting custom, non-default repositories.

Because this vulnerability also facilitates command option injection in the VCS layer (such as Git or Subversion), it exposes systems to immediate command execution. An attacker who injects command options prefixed with hyphens into the repository source URLs can force local command line tools to execute arbitrary processes. The combined vulnerability vectors represent a critical threat to developmental pipelines and software supply chain integrity.

Remediation and Defenses

Remediation requires immediate upgrade of Composer installations to the non-vulnerable versions released by the maintainers. For environments leveraging the standard v2.x release track, administrators must upgrade to version 2.10.2 or later. If the infrastructure relies on the legacy long-term support branch, installations must be updated to version 2.2.29 or newer.

To perform the upgrade, administrators can leverage the built-in self-update utility by executing composer self-update --stable. For containerized build pipelines, Docker files must be modified to fetch the specified secure releases during the build stage. It is recommended to automate these version updates to prevent the regression of dependency management components.

As a supplementary defense-in-depth practice, developers should limit the configuration of custom package repositories in composer.json and avoid referencing untrusted sources. Running Composer within isolated container environments with restricted file system permissions minimizes the damage an arbitrary file write can cause. Additionally, integrating the composer audit check inside continuous deployment pipelines helps identify and isolate outdated dependencies before resolution occurs.

Official Patches

ComposerComposer v2.10.2 Release
ComposerComposer v2.2.29 Release

Fix Analysis (2)

Technical Appendix

CVSS Score
7.0/ 10
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Probability
0.13%
Top 97% most exploited

Affected Systems

Composer (PHP Dependency Manager)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Composer
Composer
>= 1.0, < 2.2.292.2.29
Composer
Composer
>= 2.3.0, < 2.10.22.10.2
AttributeDetail
CWE IDCWE-22 (Path Traversal), CWE-787 (Out-of-bounds Write)
Attack VectorLocal (Requires user interaction to run Composer commands)
CVSS Score7.0 (High)
EPSS Score0.00132 (Percentile: 3.13%)
ImpactArbitrary File Write, Remote Code Execution (RCE) via path traversal
Exploit StatusProof-of-Concept via unit tests, no active exploitation
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
T1203Exploitation for Client Execution
Execution
T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The software uses external input to construct a pathname that is intended to be within a restricted directory, but it does not properly neutralize special elements within the pathname.

Vulnerability Timeline

Telemetry changes prepared for release line
2026-06-04
Advisory branch created internally
2026-07-01
Coordinated public disclosure of CVE-2026-59948 and release of patches
2026-07-08
NVD record published
2026-07-10

References & Sources

  • [1]GitHub Security Advisory GHSA-499r-g7pc-vmp9
  • [2]CVE-2026-59948 on CVE.org
  • [3]NVD Vulnerability Details

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-12243
7.5

CVE-2026-12243: Incomplete Path Traversal Validation and Percent-Encoding Bypass in NLTK

CVE-2026-12243 is a path traversal vulnerability in the Natural Language Toolkit (NLTK) version 3.9.4. The flaw exists because the input validation routine fails to account for percent-encoded directory traversal sequences like '..%2f' before passing them to urllib.request.url2pathname(), which decodes them into active traversal sequences.

Amit Schendel
Amit Schendel
2 views•8 min read
•about 4 hours ago•CVE-2026-73654
8.5

CVE-2026-73654: Prototype Pollution in Trigger.dev leading to Cascading Denial of Service

CVE-2026-73654 is a high-severity prototype pollution vulnerability in Trigger.dev. The flaw occurs during the handling of run-metadata updates through the PUT /api/v1/runs/:runId/metadata endpoint. Because user-supplied keys are parsed directly by the @jsonhero/path library without sanitization, an authenticated attacker with low privileges can pollute the global Object.prototype. This causes database queries via Prisma ORM to fail validation and induces unhandled exceptions in the Prometheus metrics client, resulting in a process-wide denial of service.

Alon Barad
Alon Barad
7 views•6 min read
•about 6 hours ago•CVE-2026-73559
6.5

CVE-2026-73559: Uncontrolled Resource Consumption in vLLM API completions

CVE-2026-73559 is an uncontrolled resource consumption vulnerability in the vLLM engine, specifically within the /v1/completions API endpoint, allowing authenticated attackers to cause application-level denial of service via unbounded prompt arrays.

Amit Schendel
Amit Schendel
5 views•5 min read
•about 8 hours ago•CVE-2026-54526
9.9

CVE-2026-54526: Strict Template Referencing Bypass and Privilege Escalation in Argo Workflows

A critical security bypass vulnerability in Argo Workflows allows authenticated attackers with workflow submission privileges to bypass 'Strict' or 'Secure' template referencing restrictions. By injecting unvalidated fields into the nested ArtifactGC configuration, attackers can execute arbitrary pod patches, leading to host namespace escape and cluster-wide privilege escalation.

Alon Barad
Alon Barad
10 views•6 min read
•about 9 hours ago•CVE-2026-54249
6.8

CVE-2026-54249: Server-Side Request Forgery via Confused Deputy in Pydantic AI UI Adapters

A Server-Side Request Forgery (SSRF) / Confused Deputy vulnerability has been identified in Pydantic AI UI Adapters (such as VercelAIAdapter). Under certain conditions, a malicious client can supply manipulated message history with provider metadata that forces the server to resolve files within privileged cloud environments (AWS S3, Google Cloud Storage) or model providers. This occurs because the adapters deserialize client-provided metadata structures directly into UploadedFile instances without validation, which are subsequently fetched using high-privilege server credentials.

Alon Barad
Alon Barad
5 views•7 min read
•about 10 hours ago•GHSA-RM43-82J9-R4MJ
8.2

GHSA-RM43-82J9-R4MJ: Path Traversal (Arbitrary File Read) in atomic-agents-stack Dashboard

A path traversal vulnerability in the optional dashboard server of atomic-agents-stack before version 1.1.0 allows unauthenticated remote attackers to read arbitrary files from the host filesystem.

Amit Schendel
Amit Schendel
4 views•6 min read