CVE-2026-59946: 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.
References
- github.com/advisories/GHSA-gjfg-22fp-rrxx
- github.com/composer/composer/commit/502c6c4f699802d9cf464728b3e8a95674f919a0
- github.com/composer/composer/commit/c50b1efd13ebd73f6dca19b31424c5a02bf93cc1
- github.com/composer/composer/releases/tag/2.10.2
- github.com/composer/composer/releases/tag/2.2.29
- github.com/composer/composer/security/advisories/GHSA-gjfg-22fp-rrxx
- nvd.nist.gov/vuln/detail/CVE-2026-59946
Code Behaviors & Features
Detect and mitigate CVE-2026-59946 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →