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

High 7.0 Published Updated

Attackers can write arbitrary files outside the vendor directory via malicious package names, potentially leading to code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-59948?

CVE-2026-59948 is a high-severity path traversal vulnerability in composer, published on 8 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

Composer is a dependency Manager for the PHP language. Prior to 2.2.29 and 2.10.2, a maliciously crafted package from an untrusted repository other than Packagist.org or Private Packagist can cause Composer to write attacker-controlled files outside the vendor directory and outside the project during install or update by using an invalid package name that is not correctly validated before dependency-resolution results are written or installed. This issue is fixed in versions 2.2.29 and 2.10.2.

Weakness: CWE-787, CWE-22

Which versions are affected by CVE-2026-59948?

5 open source packages ship an affected version, including composer/composer and composer.

PackageAffectedFixed in
composer/composer PackagistFrom 1.0.02.2.29
composer/composer PackagistFrom 1.0.02.2.29
composer/composer PackagistFrom 2.3.02.10.2
composer/composer PackagistFrom 2.3.02.10.2
composer BitnamiFrom 1.0.02.2.29, 2.10.2

How do I fix CVE-2026-59948?

Upgrade composer/composer to a fixed version for your release line: 2.2.29 or 2.10.2.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2026-59948 being exploited?

There is no known exploitation of CVE-2026-59948 in the wild and no public exploit code.

Sources

Also known as BIT-composer-2026-59948, CLEANSTART-2026-UO36556, DEBIAN-CVE-2026-59948, GHSA-499r-g7pc-vmp9, MINI-9g3c-8rrh-6xvc, MINI-mjgq-whqr-q4w2 and 1 more.

Is CVE-2026-59948 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free