HIGH 7.3

CVE-2026-50015: pnpm Path Traversal in Patch Application

pnpm, a popular package manager, has a path traversal vulnerability in its patch application system that allows malicious actors to write or delete files outside the intended package directory. An attacker can exploit this by submitting a pull request with a specially crafted .patch file containing directory traversal sequences (../../). When another developer runs pnpm install, the malicious patch executes with their privileges, potentially compromising the system. The vulnerability affects versions prior to 10.34.0 and 11.4.0, where it has been patched.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.3 HIGH · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H
Weaknesses (CWE)
CWE-22
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's patch application pipeline (@pnpm/patch-package) performs no path validation on file paths extracted from .patch files. An attacker who contributes a malicious patch file via a pull request can write attacker-controlled content to or delete arbitrary files on the filesystem during pnpm install, as the user running the install. The diff --git header paths containing ../../ sequences traverse out of the package directory, and the traversal is difficult to catch in code review because patch file diff headers are opaque to most reviewers. 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 @pnpm/patch-package module fails to validate file paths extracted from .patch files before applying them to the filesystem. The vulnerability stems from insufficient sanitization of diff --git header paths, which commonly contain relative path sequences that can escape the package directory boundary. An attacker crafting a patch with paths such as ../../sensitive/file enables arbitrary file write or deletion with the privileges of the user executing pnpm install. The attack vector is low-complexity and leverages pull request mechanisms—a common development workflow—making it accessible to internal or external contributors. The CVSS 3.1 score of 7.3 (HIGH) reflects high integrity and availability impact without confidentiality risk.

Business impact

Development teams using pnpm face supply-chain risk during routine dependency updates and patch application workflows. A successful attack could result in system file corruption, configuration tampering, or deletion of critical application files without detection during code review, since patch files are often opaque to human reviewers. For organizations with automated CI/CD pipelines that run pnpm install without manual review, the blast radius extends to build infrastructure and downstream deployments. Trust in internally maintained patches and community contributions is compromised until upgrades are applied.

Affected systems

pnpm versions prior to 10.34.0 and 11.4.0 are affected. Any system or CI/CD pipeline running a vulnerable version and processing .patch files—whether from pull requests, internal repositories, or package updates—is at risk. The impact depends on the privileges of the user running pnpm install; developers and automated build systems are primary targets.

Exploitability

Exploitability is straightforward for an attacker with pull request access or the ability to contribute patches to a project using pnpm. The attack requires user interaction (a developer running pnpm install) and relies on the difficulty of detecting traversal sequences in patch file headers during code review. No special tools or privileges are needed to craft the malicious patch, and the payload executes immediately during install, making detection challenging if filesystem changes are not monitored.

Remediation

Upgrade pnpm to version 10.34.0 or later (or 11.4.0 or later for the 11.x branch). Organizations should prioritize updates in development environments and CI/CD pipelines. Additionally, implement code review practices that include scrutiny of .patch file paths, use of signed commits to verify contributor identity, and monitoring of filesystem changes during package installation.

Patch guidance

Apply updates from pnpm's official release channels: pnpm 10.34.0 or later addresses the vulnerability in the 10.x series, and pnpm 11.4.0 or later is the fix for 11.x users. Verify the patched version against the vendor advisory to confirm the specific build resolves this issue. For organizations with locked dependency versions, update pnpm in your package.json or lock files and re-test development and build workflows before rolling out to CI/CD pipelines.

Detection guidance

Monitor pnpm installation logs and filesystem activity for unexpected file writes or deletions outside project directories. Audit .patch files in repositories for paths containing ../../ sequences or other relative traversal patterns. Implement pre-commit hooks to validate patch file structure and alert on suspicious paths. Check current pnpm version across development machines and CI/CD runners using pnpm -v or package lock metadata to identify systems still running vulnerable versions.

Why prioritize this

This vulnerability merits immediate attention due to its combination of high integrity and availability impact, ease of exploitation, and prevalence of pnpm in modern JavaScript development workflows. The supply-chain attack vector via pull requests means the risk is not limited to external threats; insider risk or compromised accounts can weaponize the vulnerability. The opaque nature of patch files in code review makes detection difficult, increasing the likelihood of successful exploitation before discovery.

Risk score, explained

The CVSS 3.1 score of 7.3 (HIGH) reflects the vulnerability's high impact on file system integrity and availability (arbitrary write/delete), low attack complexity, and requirement for low privilege (user contribution via pull request) combined with user interaction (running pnpm install). The absence of confidentiality impact prevents a critical rating, but the attack's ease and supply-chain implications justify aggressive remediation prioritization beyond the numerical score alone.

Frequently asked questions

Can this vulnerability be exploited without submitting a pull request?

The primary attack surface is pull request contribution, but any mechanism that introduces a malicious .patch file into a project—such as a compromised dependency, internal repository access, or social engineering—could enable exploitation. The vulnerability is triggered whenever pnpm install processes an untrusted patch file.

Does upgrading pnpm automatically fix existing malicious patches in my repository?

No. Upgrading pnpm prevents future exploitation by validating patch paths, but you must audit existing .patch files in your repository for suspicious traversal sequences and remove or replace any compromised patches. The upgrade itself does not retroactively clean malicious patches that may have already been applied.

Should we disable patch functionality entirely?

Disabling patches is an option if your workflows do not require them, but a targeted approach is preferable: upgrade to the patched version, audit your patch files, implement code review practices that scrutinize patch paths, and use signed commits to verify contributor identity. This balances security with operational flexibility.

How can we detect if this vulnerability was exploited in our codebase?

Review commit history and file change logs around times when pnpm install was run with potentially malicious patches. Monitor for unexplained file deletions, modifications to configuration files, or system binaries outside normal deployment workflows. Tools that track filesystem changes during CI/CD runs can help identify anomalies.

This analysis is provided for informational purposes and represents the current understanding of CVE-2026-50015 based on available source data. Security assessments should be tailored to your environment, dependencies, and risk posture. Always verify patch availability and compatibility before deployment. Consult pnpm's official security advisories and your organization's change management procedures. SEC.co is not liable for damages resulting from vulnerability exploitation or remediation errors. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).