HIGH 8.8

CVE-2026-50016: pnpm Path Traversal Vulnerability in Dependency Alias Handling

pnpm, a widely-used Node.js package manager, contains a path traversal vulnerability affecting versions before 10.34.0 and 11.4.0. A malicious package published to a registry can craft dependency alias metadata containing directory traversal sequences (like '../'). When you run `pnpm install --ignore-scripts`, pnpm treats this alias as a filesystem path without proper validation, allowing the attacker's package to create symlinks that overwrite legitimate files and directories in your project with links pointing to the attacker's package folders. This means an attacker can potentially replace critical project files with their controlled content, even when you explicitly disable script execution during installation.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.8 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-23
Affected products
1 configuration(s)
Published / Modified
2026-06-25 / 2026-06-29

NVD description (verbatim)

pnpm is a package manager. Prior to 10.34.0 and 11.4.0, pnpm allows a transitive dependency alias from registry package metadata to contain path traversal segments. During install, pnpm later uses that alias as a filesystem path when linking dependency nodes. As a result, a registry package can cause `pnpm install --ignore-scripts` to replace paths in the current project with symlinks to attacker-controlled dependency package directories. This vulnerability is fixed in 10.34.0 and 11.4.0.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from insufficient path sanitization when pnpm processes transitive dependency aliases from registry package metadata. During the dependency resolution and linking phase, pnpm constructs filesystem paths directly from alias values without validating against path traversal patterns. An attacker can embed segments like '../../../' within a package's dependency alias declaration, causing pnpm to resolve these paths outside the intended node_modules directory structure. When symlinks are created during the install process, they become anchored to attacker-controlled package directories rather than legitimate dependency locations. The issue is classified as CWE-23 (Relative Path Traversal), and the vulnerability persists regardless of the --ignore-scripts flag, meaning users cannot mitigate it through script execution controls alone.

Business impact

This vulnerability poses significant supply chain risk for development teams. An attacker can compromise a project's source tree by replacing configuration files, build scripts, or source code with symlinks to attacker-controlled content. Teams relying on pnpm for dependency management face potential code injection, intellectual property theft (via symlinks to monitored directories), and disruption of build pipelines. The attack requires no user interaction beyond running a standard installation command, and it affects both direct and transitive dependencies, expanding the attack surface. Organizations with automated CI/CD pipelines running `pnpm install` without current versions are particularly vulnerable to silent, undetected compromise.

Affected systems

pnpm versions prior to 10.34.0 (for the 10.x line) and prior to 11.4.0 (for the 11.x line) are affected. Any development environment or CI/CD system using these versions to install Node.js dependencies is at risk. The attack vector is network-based and requires the attacker to control or compromise a package on a registry accessible to the target environment. Both npm registry and private/internal registries are potential vectors if they allow untrusted or compromised packages.

Exploitability

This vulnerability has a CVSS 3.1 score of 8.8 (HIGH) with a network-based attack vector, low complexity, no required privileges, and user interaction limited to running a standard install command. While the attack requires the attacker to publish or compromise a package on a registry and for a target to install that package (directly or transitively), the barrier to exploitation is low. A malicious package in a popular transitive dependency chain could silently compromise many projects. No CISA KEV listing exists yet, and no public exploit code has been verified at the time of this advisory, but the straightforward nature of path traversal attacks suggests rapid weaponization is probable once awareness spreads.

Remediation

Upgrade pnpm to version 10.34.0 or later if using the 10.x branch, or to version 11.4.0 or later if using the 11.x branch. These versions include proper path sanitization to reject alias values containing traversal sequences. Perform the upgrade in controlled environments and re-run `pnpm install` to regenerate lock files and ensure no malicious symlinks from previous runs persist. For environments unable to upgrade immediately, audit your pnpm-lock.yaml file for suspicious alias entries containing '../' or '.\' patterns, and manually inspect the node_modules directory for unexpected symlinks pointing outside expected locations.

Patch guidance

Verify the version of pnpm currently in use via `pnpm --version`. Update using your standard Node.js tooling (e.g., `npm install -g pnpm@latest` or via package managers like brew, apt, or choco depending on your platform). After upgrading, clear your node_modules directory and pnpm-lock.yaml file, then run `pnpm install` fresh. Test your build pipeline in a non-production environment first to confirm compatibility. If you use pnpm via CI/CD containers, update your base images and rebuild them. Document the upgrade in your change management system, particularly if pnpm version pinning is enforced across teams.

Detection guidance

Check your current pnpm version against the patched versions (10.34.0+, 11.4.0+). Review pnpm-lock.yaml files for suspicious alias entries containing path traversal sequences like '../', '..\', or similar patterns. Scan node_modules directories for symlinks using commands like `find node_modules -type l` and manually verify that symlinks target expected locations within node_modules or globally installed packages. Implement registry integrity monitoring if using private registries. Monitor for unexpected file modifications in your project root and source directories, especially if your CI/CD logs show package installation steps. Use Software Composition Analysis (SCA) tools configured to flag known vulnerable pnpm versions.

Why prioritize this

This vulnerability merits immediate remediation because it affects supply chain integrity with HIGH severity, has a low barrier to exploitation once weaponized, and strikes at a fundamental trust assumption in the package installation process. The attack can silently compromise projects without triggering visible errors, making it a particularly insidious supply chain risk. Organizations with automated CI/CD pipelines are at elevated risk and should prioritize patching to prevent persistent compromise of build artifacts and deployed code.

Risk score, explained

The CVSS 3.1 score of 8.8 reflects the high confidentiality, integrity, and availability impact (an attacker can read, modify, or delete project files via symlink replacement), combined with network-based attack delivery and low complexity. The user interaction requirement (running pnpm install) is a minor limiting factor but not a substantial barrier in practical development workflows. The lack of current CISA KEV listing does not diminish the severity; this represents a known, exploitable vulnerability in widely-used software.

Frequently asked questions

Can I detect if my project was compromised by this vulnerability?

Check your node_modules directory for symlinks pointing to unexpected locations (commands like `find node_modules -type l` or `ls -l` on suspicious paths). Review your version control history for unexpected file changes coinciding with dependency updates. Look for broken build processes or missing files after running `pnpm install` with an old version. A compromise may manifest as subtle file replacements, so manual inspection and integrity checks are necessary.

Does the --ignore-scripts flag protect against this vulnerability?

No. While --ignore-scripts prevents arbitrary code execution from preinstall or postinstall hooks, this vulnerability operates at the filesystem linking stage, which occurs before and independently of script execution. The attacker's malicious symlinks are created during normal dependency resolution, not through package scripts, so the flag provides no protection.

If I'm using a private registry, am I still at risk?

Yes. An attacker who gains access to your private registry, or who exploits a registry administrator account, can publish malicious packages with traversal aliases. Additionally, if your private registry proxies public registries, a compromised public package could propagate transitive dependencies with malicious aliases. Assume all registries are potential attack vectors until they are patched against this vulnerability.

What should I do about lock files generated by vulnerable versions?

Lock files (pnpm-lock.yaml) from vulnerable versions may contain aliases with traversal sequences if they installed malicious packages. After upgrading pnpm, delete your lock file and node_modules directory, then run `pnpm install` fresh to regenerate them. This ensures a clean state. If you need to audit historical lock files for evidence of compromise, search for suspicious alias entries containing '../' or similar patterns.

This analysis is provided for informational purposes to support vulnerability management and risk assessment. The information contained herein reflects publicly available data at the time of publication and is not guaranteed to be complete or error-free. Verify all patch versions, affected products, and remediation steps against official vendor advisories before implementing changes. Organizations should conduct their own risk assessments and testing in controlled environments prior to deploying patches to production systems. SEC.co does not warrant that the remediation guidance is suitable for all environments and recommends consulting with your security and development teams. No liability is accepted for damages arising from the use or misuse of this information. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).