# Composer: Arbitrary file write outside vendor via malicious transitive package name

High severity, published 2026-07-20. Update composer/composer to the fixed version of your branch (2.10.2, 2.2.29): composer update composer/composer.

Canonical URL: https://buzzphp.com/security/ghsa-499r-g7pc-vmp9 · Data from GitHub as of 2026-11-25.

| | |
| --- | --- |
| Severity | high (CVSS 7) |
| Published | 2026-07-20 |
| Updated | 2026-07-20 |
| CVE | [CVE-2026-59948](https://nvd.nist.gov/vuln/detail/CVE-2026-59948) |
| GHSA | [GHSA-499r-g7pc-vmp9](https://github.com/advisories/GHSA-499r-g7pc-vmp9) |
| Weakness | CWE-22, CWE-787 |

| Package | Affected versions | Fixed in |
| --- | --- | --- |
| composer/composer | >= 2.3.0, < 2.10.2 or >= 1.0.0, < 2.2.29 | 2.10.2, 2.2.29 |

## What to do

Update composer/composer to the fixed version of your branch (2.10.2, 2.2.29): composer update composer/composer.

Check which version you run with `composer show composer/composer`, and every affected package with `composer audit`.

## About this advisory

Summary

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 authorizedkeys, or a cron entry).

## Links

- [GHSA-499r-g7pc-vmp9 on GitHub](https://github.com/advisories/GHSA-499r-g7pc-vmp9)
- [CVE-2026-59948 on the National Vulnerability Database](https://nvd.nist.gov/vuln/detail/CVE-2026-59948)
- [All Composer security advisories](https://buzzphp.com/security)
