pnpm Path Traversal Vulnerability in directories.bin Field Allows Arbitrary File Permission Modification

Vulnerability

A path traversal vulnerability has been identified in pnpm, a package manager, prior to version 10.28.2. When pnpm processes a package's directories.bin field, it uses path.join() without validating that the result remains within the package root. This oversight allows a malicious npm package to specify a bin directory that escapes the package directory, leading to unauthorized modification of file permissions at arbitrary locations. The vulnerability affects Unix, Linux, and macOS systems, while Windows is not impacted.

Impact

Exploitation of this vulnerability allows for arbitrary modification of file permissions, changing them from 600 to 755, which is world-readable. This could be exploited by a malicious npm package to access sensitive information or execute scripts that were not intended to be publicly accessible.

Reproduction

To reproduce this vulnerability, create a malicious npm package that includes a directories.bin field pointing to a location outside the package directory. After publishing this package, install it using pnpm. The installation process will traverse the file system, bypassing the package root validation, and change the permissions of any files in the target location to be world-readable.

Remediation

Users can upgrade to pnpm version 10.28.2 or later, where this vulnerability has been patched.

Added: Jan 26, 2026, 10:19 PM
Updated: Jan 26, 2026, 10:19 PM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
1.0
exploitability
5.4
remediation
7.7
relevance
2.4
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.