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

Source: https://junglewise.ai/threats/cve-2026-24131-pnpm-path-traversal-via-directories-bin  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-01-26. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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

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.

Technologies: [pnpm (npm)](https://junglewise.ai/threats/technologies/pnpm). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-24131 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-24131 being exploited in the wild.

**How severe is CVE-2026-24131?** Medium severity, with a CVSS score of 4, published 26 January 2026.

**Which products and versions are affected?** pnpm (npm) SEMVER:introduced=0,fixed=10.28.2.

**Is there a fix for CVE-2026-24131?** Yes. pnpm (npm): upgrade to 10.28.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-24131 attacked?** It is attacked with local access.

**Am I affected by CVE-2026-24131?** Check whether you run pnpm (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pnpm (npm): upgrade to 10.28.2 or later

  ```sh
  npm install pnpm@10.28.2
  ```


## 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

## Identifiers

- CVE-2026-24131
- GHSA-v253-rj99-jwpq

## Timeline

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

## References

- [https://github.com/pnpm/pnpm/security/advisories/GHSA-v253-rj99-jwpq](https://github.com/pnpm/pnpm/security/advisories/GHSA-v253-rj99-jwpq)
- [https://github.com/pnpm/pnpm/commit/17432ad5bbed5c2e77255ca6d56a1449bbcfd943](https://github.com/pnpm/pnpm/commit/17432ad5bbed5c2e77255ca6d56a1449bbcfd943)

## Related threats

- [pnpm environment secret exfiltration via proxy settings in workspace manifest](https://junglewise.ai/threats/pnpm-environment-secret-exfiltration-via-proxy-settings-in-workspace-f6626cca)
- [pnpm pacquet path traversal in lockfile dependency symlinks](https://junglewise.ai/threats/pnpm-pacquet-path-traversal-in-lockfile-dependency-symlinks-dc3f81d1)
- [pnpm tarball dependency manifest name path traversal arbitrary file write](https://junglewise.ai/threats/cve-2026-82393-pnpm-tarball-dependency-manifest-name-path-traversal-arbitrary)
- [pnpm virtual store linker path traversal via unvalidated depPath](https://junglewise.ai/threats/cve-2026-82392-pnpm-virtual-store-linker-path-traversal-via-unvalidated-deppath)
- [pnpm path traversal via crafted lockfile alias](https://junglewise.ai/threats/cve-2026-59196-pnpm-path-traversal-via-crafted-lockfile-alias)
