Junglewise Threat Intelligence

CVE-2026-24131: pnpm path traversal via directories.bin

CVE-2026-24131 · Severity: medium · CVSS 4 · Published 2026-01-26

Executive brief

pnpm is a package manager for JavaScript that installs and manages dependencies for development projects. When pnpm processes malicious npm packages, an attacker can exploit a path traversal flaw in the directories.bin field to modify file permissions on any location in the filesystem (Unix/Linux/macOS only), potentially making sensitive files world-readable and enabling further compromise of the developer's system.

Technical details

The vulnerability is a path traversal flaw (CWE-22) in pnpm's pkg-manager/package-bins/src/index.ts where the directories.bin field is processed using path.join() without validating that the resulting path remains within the package root directory. An attacker can craft a malicious npm package with "directories": {"bin": "../../../../tmp"} to escape the package directory; pnpm then applies chmod 755 to arbitrary files at the traversed path, changing their permissions from restricted (600) to world-readable (755), constituting incorrect permission assignment (CWE-732). The attack requires installing a malicious package but no user interaction beyond that. The fix, available in version 10.28.2, adds isSubdir() validation to reject paths outside the package root. Windows is not affected due to platform-specific gating.

Affected products

  • pnpm pnpm < 10.28.2

Timeline

  • 2026-01-26: disclosed
  • 2026-01-26: patched: Fix released in pnpm 10.28.2

References

Related threats