pnpm is vulnerable to Path Traversal
84
High Risk
During pnpm install, the isolated (virtual-store) linker, the Plug'n'Play resolver map, and the global-virtual-store slot builder construct filesystem paths from lockfile-controlled dependency names/aliases and from a dependency's own manifest name and version without validating them for path traversal. A crafted pnpm-lock.yaml entry, or a malicious dependency whose manifest name, alias, or snapshot version contains ../ sequences, can make the installer write package content, symlinks, or bins outside node_modules and the virtual store, even with --ignore-scripts or --frozen-lockfile --trust-lockfile. This lets a malicious dependency overwrite existing files such as shell startup files or git hooks, leading to code execution when the victim later runs a normal command. The fix routes these names through containment guards (safeJoinModulesDir and an unconditional lockfile dependency-name check) and rejects traversal names, aliases, and version segments with ERR_PNPM_INVALID_DEPENDENCY_NAME.
You are affected if you are using a version that falls within the vulnerable range.
pnpm is vulnerable to Path Traversal in versions 6.25.0 - 10.34.4 and 11.0.0 - 11.10.0.
Upgrade the pnpm and/or the @pnpm/exe library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant