Composer: Arbitrary file write outside vendor via malicious transitive package name
High severity. Published 20 July 2026. Update composer/composer to the fixed version of your branch (2.10.2, 2.2.29): composer update composer/composer.
Which versions are affected?
| Package | Affected versions | Fixed in |
|---|---|---|
| composer/composer (opens in a new tab) | >= 2.3.0, < 2.10.2 | >= 1.0.0, < 2.2.29 | 2.10.2, 2.2.29 |
What should you do?
Update every affected package you use to its fixed version, then check that nothing else in your project matches an advisory. To see which version you run, and whether anything is still affected:
composer show composer/composer
composer auditAdvisory details
| Severity | HighCVSS 7 |
|---|---|
| Published | |
| Updated | |
| CVE | CVE-2026-59948 (opens in a new tab) |
| GHSA | GHSA-499r-g7pc-vmp9 (opens in a new tab) |
| Weakness | CWE-22, CWE-787 |
What the advisory says
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).
Source: GHSA-499r-g7pc-vmp9 (opens in a new tab) in the GitHub Advisory Database (CC BY 4.0). Data from GitHub (opens in a new tab) as of .
Other recent advisories for this package
- Composer: GHSA-gjfg-22fp-rrxx fix bypass via symlinked package bin path (opens in a new tab) (medium, 2 October 2026)
- Composer arbitrary command execution via a malicious package's Perforce source URL (high, 8 September 2026)
- Composer: Path traversal in package bin field lets dependencies chmod arbitrary host files (opens in a new tab) (medium, 20 July 2026)
- Composer: URL-embedded HTTP-Basic username leaks to verbose logs (GitHub PAT exposure) (opens in a new tab) (medium, 20 July 2026)