CVE-2026-59946

CVE-2026-59946 is a medium-severity path traversal vulnerability in composer/composer (composer), affecting versions >= 2.3.0, < 2.10.2. It is fixed in 2.10.2, 2.2.29.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Composer: Path traversal in package bin field lets dependencies chmod arbitrary host files

A Composer package declares its executables in the bin field of its composer.json. When Composer installs a package, it processes each bin entry and changes the file mode of the corresponding file so it is executable.

If a bin entry contains .. path segments, it can resolve to a path outside the package's own install directory. A malicious package can use this to make Composer run chmod against a file that already exists elsewhere on the machine. The resulting mode is world-readable and world-executable (0755 under the common umask of 022). This happens when the package is installed, e.g. during composer install, composer update, and composer require. Any dependency can trigger it, including a transitive dependency several levels deep.

The vulnerability changes file permissions only, and does not read, modify, or execute the contents of the target file, and it is not remote code execution. The impact is to confidentiality: a file with deliberately restrictive permissions, such as a private key at mode 0600, can be made readable by other users on the same host.

Am I affected?

We reviewed packagist.org data and found no evidence that any published package exploited this vulnerability. If you install packages only from packagist.org, you are not affected by any known exploitation.

You are potentially affected if all of the following are true:

  • Your Composer project depends, directly or transitively, on a package you do not fully trust.
  • A file you rely on for its restrictive permissions already exists at a path the Composer process can write to. Examples include SSH private keys, .env files, ~/.aws/credentials, and .netrc.

The most likely way to be affected is to add or update a dependency that is malicious or has been compromised, then run an install on a machine that holds sensitive, permission-restricted files.

Two points to note:

  • --no-scripts, --no-plugins, and an allow-plugins allow-list do not prevent this. The permission change happens during normal binary installation, outside the plugin and script trust model.
  • Impact scales with privilege: As a regular user, only files owned by that user can be affected, which typically means your own secrets becoming readable by other local users on a shared machine. As root (for example, a CI container with no non-root user, or sudo composer install), any file on the system can be affected, including system credential stores.

Patched versions

The fix makes Composer reject any package whose binary entry contains a .. path segment. During install/update the operation aborts before any file permission is changed, and the same check now also applies when a package is published to Packagist.org, so such packages are refused upstream.

Fixed in 2.2.29 (2.2 LTS line) and 2.10.2 (current 2.x line). Composer 1.x is end of life and will not be patched. 1.x users should upgrade to a patched 2.x release.

Workarounds

Upgrading to a patched release is the only complete fix. There is no configuration option that disables the vulnerable behavior.

Impact

Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.

CVE-2026-59946 has a CVSS score of 6.1 (Medium). The vector is requires local access, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.10.2, 2.2.29); upgrading removes the vulnerable code path.

Affected versions

composer/composer (>= 2.3.0, < 2.10.2) composer/composer (>= 1.0.0, < 2.2.29)

Security releases

composer/composer → 2.10.2 (composer) composer/composer → 2.2.29 (composer)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade the following packages to resolve this vulnerability:

composer/composer to 2.10.2 or later; composer/composer to 2.2.29 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-59946? CVE-2026-59946 is a medium-severity path traversal vulnerability in composer/composer (composer), affecting versions >= 2.3.0, < 2.10.2. It is fixed in 2.10.2, 2.2.29. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
  2. How severe is CVE-2026-59946? CVE-2026-59946 has a CVSS score of 6.1 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of composer/composer are affected by CVE-2026-59946? composer/composer (composer) versions >= 2.3.0, < 2.10.2 is affected.
  4. Is there a fix for CVE-2026-59946? Yes. CVE-2026-59946 is fixed in 2.10.2, 2.2.29. Upgrade to this version or later.
  5. Is CVE-2026-59946 exploitable, and should I be worried? Whether CVE-2026-59946 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-59946 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-59946?
    • Upgrade composer/composer to 2.10.2 or later
    • Upgrade composer/composer to 2.2.29 or later

Other vulnerabilities in composer/composer

Stop the waste.
Protect your environment with Kodem.