Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. composer/composer
  4. ›
  5. CVE-2026-59948

CVE-2026-59948: Composer: Arbitrary file write outside vendor via malicious transitive package name

July 20, 2026

A maliciously crafted package, published on an untrusted third party repository other than Packagist.org or Private Packagist, can cause Composer to write files outside the vendor/ directory and outside your project, with attacker-controlled content, during a normal install or update through using an invalid package name, which was not correctly validated by Composer.

This is an arbitrary file write that can be used to execute code outside the Composer project’s context in which you expected the package code to execute (for example by writing shell startup files, SSH authorized_keys, or a cron entry). It is a supply-chain issue: it requires a malicious or compromised package to be present in the dependency graph, it is not otherwise remotely exploitable against a machine.

The fix makes Composer validate every package produced by dependency resolution before anything is written to composer.lock or installed, and abort with a security error if a package name is not a valid vendor/package name.

References

  • github.com/advisories/GHSA-499r-g7pc-vmp9
  • github.com/composer/composer/commit/502c6c4f699802d9cf464728b3e8a95674f919a0
  • github.com/composer/composer/commit/c50b1efd13ebd73f6dca19b31424c5a02bf93cc1
  • github.com/composer/composer/releases/tag/2.10.2
  • github.com/composer/composer/releases/tag/2.2.29
  • github.com/composer/composer/security/advisories/GHSA-499r-g7pc-vmp9
  • nvd.nist.gov/vuln/detail/CVE-2026-59948

Code Behaviors & Features

Detect and mitigate CVE-2026-59948 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 1.0.0 before 2.2.29, all versions starting from 2.3.0 before 2.10.2

Fixed versions

  • 2.2.29
  • 2.10.2

Solution

Upgrade to versions 2.2.29, 2.10.2 or above.

Impact 7 HIGH

CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-787: Out-of-bounds Write

Source file

packagist/composer/composer/CVE-2026-59948.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 18 Aug 2026 00:17:34 +0000.