Jun 27, 2026·4 min read·26 visits
Unsanitized 'name' and 'version' fields in downloaded package manifests allow arbitrary filesystem writes during 'pnpm stage download' operations.
A path traversal vulnerability in pnpm stage download allows malicious registries or compromised package manifests to overwrite arbitrary files on the victim's filesystem via unvalidated package name and version fields.
The pnpm stage download command fetches and stages tarballs from a designated package registry during staging operations. This process involves downloading a package tarball, extracting its embedded package.json manifest, and determining a local staging path to write the artifact. The attack surface is exposed to any network registry or upstream repository configured by the user.\n\nAn attacker who controls a registry or compromises an upstream package can supply a malicious manifest. By embedding directory traversal sequences in metadata fields, the attacker can hijack the target write location. This allows arbitrary file write or overwrite operations under the privileges of the active user executing the command.
The root cause of this vulnerability lies in the unvalidated trust placed in the version and name properties of the package manifest. During staging, pnpm extracts these fields to construct a local cache or staging filename. The application relies on normalizePackageName() to replace slashes and remove symbols, but it performs no validation on the version string.\n\nBecause the version field is untrusted input, an attacker hosting a malicious registry or publishing a compromised manifest can define a version containing traversal sequences. When path.resolve() dynamically resolves the absolute path using this unsanitized string, the resulting destination path escapes the designated download directory. This allows writing the tarball payload to an arbitrary location on the filesystem.
The vulnerable logic resolves the output directory and file write path using the package name and version fields directly:\n\ntypescript\nconst downloadDir = opts.dir ?? process.cwd()\nconst outputPath = path.resolve(downloadDir, filename)\nawait fs.writeFile(outputPath, tarballData)\n\n\nmermaid\ngraph LR\n Registry[\"Malicious Registry\"] -->|\"package.json name/version\"| PNPM[\"pnpm stage download\"]\n PNPM -->|\"Unsanitized path.resolve\"| PathConcat[\"outputPath: /sandbox/../../etc/cron.d/job\"]\n PathConcat -->|\"fs.writeFile\"| OS[\"File Written Outside Sandbox\"]\n\n\nTo patch this vulnerability in commit 65443f4bdf1f0db9c8c7dc58fee25252607e9234, the maintainers introduced strict validation checks on the derived filename. The fix utilizes standard validation libraries to enforce format rules on both the package name and version before deriving the filename. Package names are validated using validate-npm-package-name, and semantic versions are validated using the semver validator, which blocks path traversal characters like / or .. from passing. Additionally, the path resolution step now enforces that the parent directory of the final absolute output path strictly matches the intended download directory.
An attacker exploiting this vulnerability must control the package registry or intercept the package response to inject a crafted manifest. When the victim executes pnpm stage download, the client issues a request to the configured registry.\n\nThe registry responds with a package payload containing a crafted package.json. In this manifest, the version field is set to a relative traversal path, such as 1.0.0/../../../../etc/cron.d/malicious_job.\n\nUpon receiving this response, pnpm builds the destination path using the malicious string and writes the tarball. The tarball's binary content is written directly to the target system path, enabling potential local privilege escalation (LPE) or persistent execution when the system triggers the written file.
The integrity impact is rated as High because an attacker can overwrite arbitrary files accessible to the execution context. Depending on whether pnpm is run by a standard user or an administrative CI/CD service, the impact ranges from local source code modification to full system compromise.\n\nThe availability impact is Low because overwriting critical system configuration or executable files can cause system services to fail. The vulnerability holds a CVSS v3.1 score of 7.1, reflecting that network-level positioning is sufficient to initiate the attack, provided user interaction (running the command) is achieved.\n\nCurrently, there is no active exploitation reported in the wild, placing the EPSS score at a low baseline. However, the presence of public regression tests acts as a functional Proof-of-Concept, making rapid exploitation feasible if target conditions are met.
Users must update pnpm immediately to version 11.5.3 or higher. This release contains the complete structural and semantic verification mechanisms to block directory traversal payloads in both the package name and version fields.\n\nIf immediate patching is not possible, restrict network communication to trusted registries and verify that package registries employ robust metadata sanitization before distributing packages to downstream clients.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
pnpm pnpm | < 11.5.3 | 11.5.3 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-22 |
| Attack Vector | Network |
| CVSS | 7.1 |
| EPSS | 0.00258 |
| Impact | High Integrity, Low Availability |
| Exploit Status | poc |
| KEV Status | Not Listed |
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
An authentication bypass in the SiYuan personal knowledge management system before version 3.7.0 exposes a dynamic icon rendering endpoint. This endpoint processes client-supplied Go template directives. By submitting a crafted request, an unauthenticated remote attacker can leverage registered database template functions to execute arbitrary read-only SQL queries and exfiltrate workspace contents.
CVE-2026-54069 is a critical authentication bypass vulnerability in the SiYuan Note personal knowledge management system. The flaw is located in the HTTP server's middleware handling API authorization, which unconditionally trusts requests carrying a 'chrome-extension://' scheme in the Origin HTTP header, granting administrative access without validating API tokens.
CVE-2026-54089 is a critical authentication bypass vulnerability in File Browser affecting instances configured with proxy-based authentication. An unauthenticated remote attacker with direct network access can impersonate arbitrary users or register new accounts by spoofing configured HTTP headers.
The malicious Cargo package 'exploration' was uploaded to the crates.io registry. During compilation or package import, the crate executes code designed to establish an outbound TCP/HTTP connection, download an external second-stage binary, and execute the binary locally on the host machine. This creates an unauthenticated remote code execution vector impacting developer environments and continuous integration pipelines.
CVE-2026-54088 is a critical command injection vulnerability in File Browser prior to version 2.63.6. When Hook Authentication is enabled, the application interpolates unsanitized credentials into a shell command, allowing unauthenticated remote code execution.
An authenticated remote code execution vulnerability exists in NotrinosERP (versions up to and including 1.0.0) within the Human Resource Management (HRM) module. Users with employee management permissions can upload arbitrary file types, including PHP scripts, which are written directly to a web-accessible directory. This allows for arbitrary code execution in the context of the web-server user.