6.5medium
pnpm scoped bin name Path Traversal allows arbitrary file creation outside node_modules/.bin
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.50% (higher than 44% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-xpqm-wm3m-f34h
Description
pnpm is a package manager. Prior to version 10.28.1, a path traversal vulnerability in pnpm's bin linking allows malicious npm packages to create executable shims or symlinks outside of `node_modules/.bin`. Bin names starting with `@` bypass validation, and after scope normalization, path traversal sequences like `../../` remain intact. This issue affects all pnpm users who install npm packages and CI/CD pipelines using pnpm. It can lead to overwriting config files, scripts, or other sensitive files. Version 10.28.1 contains a patch.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| pnpm pnpm | < 10.28.1, before 10.28.1 | CVE List, NVD |
| pnpm (npm) | before 10.28.1 | GitHub Advisory Database |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
pnpm is a package manager. Prior to version 10.28.1, a path traversal vulnerability in pnpm's bin linking allows malicious npm packages to create executable shims or symlinks outside of `node_modules/.bin`. Bin names starting with `@` bypass validation, and after scope normalization, path traversal sequences like `../../` remain intact. This issue affects all pnpm users who install npm packages and CI/CD pipelines using pnpm. It can lead to overwriting config files, scripts, or other sensitive files. Version 10.28.1 contains a patch.
GitHub Advisory Database
Summary
A path traversal vulnerability in pnpm's bin linking allows malicious npm packages to create executable shims or symlinks outside of node_modules/.bin. Bin names starting with @ bypass validation, and after scope normalization, path traversal sequences like ../../ remain intact.
Details
The vulnerability exists in the bin name validation and normalization logic:
1. Validation Bypass (pkg-manager/package-bins/src/index.ts)
The filter allows any bin name starting with @ to pass through without validation:
.filter((commandName) =>
encodeURIComponent(commandName) === commandName ||
commandName === '' ||
commandName[0] === '@' // <-- Bypasses validation
)
2. Incomplete Normalization (pkg-manager/package-bins/src/index.ts)
function normalizeBinName (name: string): string {
return name[0] === '@' ? name.slice(name.indexOf('/') + 1) : name
}
// Input: @scope/../../evil
// Output: ../../evil <-- Path traversal preserved!
3. Exploitation (pkg-manager/link-bins/src/index.ts:288)
The normalized name is used directly in path.join() without validation.
PoC
- Create a malicious package:
{
"name": "malicious-pkg",
"version": "1.0.0",
"bin": {
"@scope/../../.npmrc": "./malicious.js"
}
}
- Install the package:
pnpm add /path/to/malicious-pkg
- Observe
.npmrccreated in project root (outside node_modules/.bin).
Impact
- All pnpm users who install npm packages
- CI/CD pipelines using pnpm
- Can overwrite config files, scripts, or other sensitive files
Verified on pnpm main @ commit 5a0ed1d45.
NVD (es)
pnpm es un gestor de paquetes. Antes de la versión 10.28.1, una vulnerabilidad de salto de ruta en el enlace de binarios de pnpm permite a paquetes npm maliciosos crear shims ejecutables o enlaces simbólicos fuera de 'node_modules/.bin'. Los nombres de binarios que comienzan con '@' eluden la validación, y después de la normalización del ámbito, secuencias de salto de ruta como '../../' permanecen intactas. Este problema afecta a todos los usuarios de pnpm que instalan paquetes npm y a los pipelines CI/CD que utilizan pnpm. Puede llevar a la sobrescritura de archivos de configuración, scripts u otros archivos sensibles. La versión 10.28.1 contiene un parche.
References
| https://github.com/pnpm/pnpm/security/advisories/GHSA-xpqm-wm3m-f34h | exploit, vendor-advisory, web | |
| https://github.com/pnpm/pnpm/commit/8afbb1598445d37985d91fda18abb4795ae5062d | patch, web | |
| https://github.com/pnpm/pnpm/releases/tag/v10.28.1 | release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-23890 | advisory | |
| https://github.com/pnpm/pnpm | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-23890 changed 2026-01-27 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-xpqm-wm3m-f34h changed 2026-02-03 | CC-BY-4.0 |
| NVD | CVE-2026-23890 changed 2026-06-17 | Public domain |