CVE-2026-50015

pnpm: Arbitrary File Write/Delete via Malicious Patch File (Path Traversal)

Published Jun 25, 2026 CVSS 3.1 · 7.3 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability allows an attacker to write or delete arbitrary files during pnpm install, leading to potential compromise of the entire project repository. It manifests through path traversal in patch file headers that bypass file path validation, exposing the container or host filesystem to modification. This is a file system manipulation weakness classified as CWE-22.

Affected Systems

pnpm versions prior to 10.34.0 and 11.4.0 are affected. The vulnerability exists in the @pnpm/patch-package module used by pnpm, a popular JavaScript package manager. Users running pnpm install in a repository that accepts patches from pull requests are at risk if the package manager is not updated.

Risk and Exploitability

The CVSS score of 7.3 indicates high severity, but the EPSS score is not available, so the current probability of exploitation is unclear. The vulnerability is not listed in the CISA KEV catalog. The attack vector relies on a malicious patch file that is submitted via a pull request, making it likely that project maintainers can exploit the flaw by accepting a PR that contains a crafted .patch file. Because the path traversal in the diff header is opaque to most code reviews, an attacker can evade manual detection and immediately write or delete critical files during dependency installation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade pnpm to 10.34.0 or later, or to 11.4.0 or later, to apply the path validation fix
  • If an upgrade cannot be performed immediately, deny or reject pull requests that contain patch files, or manually review and sanitize patch headers to remove any '../../' sequences before application
  • Disable or remove the @pnpm/patch-package module from the project if patches are not required, ensuring that no unvalidated patch content can be applied

Generated by OpenCVE AI on June 25, 2026 at 18:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-rxhj-4m44-96r4 pnpm Vulnerable to Arbitrary File Write/Delete via Malicious Patch File (Path Traversal)
History
Type Values Removed Values Added
First Time appeared Pnpm
Pnpm pnpm
Vendors & Products Pnpm
Pnpm pnpm
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title pnpm: Arbitrary File Write/Delete via Malicious Patch File (Path Traversal)
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 7.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 25, 2026, 5:59 PM
Reserved
Jun 2, 2026, 10:46 PM
Status
Analyzed
Published
Jun 25, 2026, 6:16 PM
Modified
Jun 29, 2026, 9:15 PM
Severity
Important
Public date
Jun 25, 2026, 4:52 PM