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.
Published: 2026-07-08
Score: 7 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Composer, the PHP dependency manager, has a flaw that allows an attacker to cause the tool to write files outside the vendor directory and project root. Based on the description, it is inferred that the vulnerability originates from an invalid package name that is not correctly validated during dependency resolution, enabling a path traversal error and an out‑of‑bounds write. This leads to arbitrary file overwrite or creation, which could be used to inject malicious code or corrupt existing files, as indicated by the associated CWEs—CWE‑22 (Path Traversal) and CWE‑787 (Out‑of‑Bounds Write).

Affected Systems

The public Composer package (composer:composer) is affected in all releases prior to 2.2.29 and 2.10.2. Projects that pull dependencies from any repository other than Packagist.org or Private Packagist are potentially vulnerable, regardless of the PHP version or OS.

Risk and Exploitability

The CVSS score of 7 indicates moderate severity, while the EPSS score of fewer than 1 % implies a low current exploitation probability. The vulnerability is not listed in the CISA KEV catalog. Attackers can exploit the flaw during a composer install or update when a project includes a malicious transitive package from an untrusted repository. By manipulating a package name, the attacker can force Composer to write to locations outside the vendor directory, potentially enabling code execution or destructive tampering of project files.

Generated by OpenCVE AI on July 29, 2026 at 13:42 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Composer to version 2.2.29 or newer (including 2.10.2 and later releases).
  • Eliminate or disable any repositories in composer.json or the global Composer configuration that are not Packagist.org or Private Packagist, ensuring all dependencies come from trusted sources.
  • Review the generated lockfile for unexpected or suspicious packages and file paths, remove any that appear malicious, and refrain from installing dependencies from untrusted origins until the vendor patch is applied.

Generated by OpenCVE AI on July 29, 2026 at 13:42 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-499r-g7pc-vmp9 Composer: Arbitrary file write outside vendor via malicious transitive package name
History

Fri, 10 Jul 2026 09:30:00 +0000

Type Values Removed Values Added
First Time appeared Getcomposer
Getcomposer composer
Vendors & Products Getcomposer
Getcomposer composer

Thu, 09 Jul 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 08 Jul 2026 19:45:00 +0000

Type Values Removed Values Added
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.
Title Composer: Arbitrary file write outside vendor via malicious transitive package name
Weaknesses CWE-22
CWE-787
References
Metrics cvssV3_1

{'score': 7, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'}


Subscriptions

Getcomposer Composer
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-09T14:32:07.719Z

Reserved: 2026-07-07T18:49:15.607Z

Link: CVE-2026-59948

cve-icon Vulnrichment

Updated: 2026-07-09T14:32:04.008Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-29T13:45:02Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-787

    Out-of-bounds Write