CVE-2026-59948
JSON

7.0high

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

Severity
7.0high CVSS:3.1 by GitHub_M
Exploit likelihood
0.14% (higher than 3% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-499r-g7pc-vmp9BIT-COMPOSER-2026-59948

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.

Affected

Product or packageVersionsReported by
composer composer>= 1.0, < 2.2.29, >= 2.3.0, < 2.10.2CVE List
composer/composer (Packagist)from 2.3.0 before 2.10.2, from 1.0.0 before 2.2.29GitHub Advisory Database
composer (Bitnami)from 1.0.0 before 2.2.29, from 2.3.0 before 2.10.2Bitnami Vulnerability Database

All scores

GitHub_M7.0high CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub7.0high CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
Bitnami Vulnerability Databasehigh rating

Classification

CWE-22CWE-787

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database

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

Am I affected?

You may be affected if you install packages from an untrusted third party repository, which does not sufficiently validate package names. Packagist.org and Private Packagist are safe, as they validate package names correctly.

Patched versions

Fixed in 2.2.29 and 2.10.2. Composer 1.x is also affected and you should move to a safe 2.x release.

Workarounds

Do not use untrusted package repositories. If you have to, mirror them through an internal repository like Private Packagist.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-59948 changed 2026-07-09CVE Terms of Use
GitHub Advisory DatabaseGHSA-499r-g7pc-vmp9 changed 2026-12-01CC-BY-4.0
NVDCVE-2026-59948 changed 2026-07-10Public domain
Bitnami Vulnerability DatabaseBIT-COMPOSER-2026-59948 changed 2026-07-27Apache-2.0