npm
CVE-2026-140230
node-tar PathReservations.getDirs() quadratic memory amplification via unbounded symlink linkpath depth — uncatchable OOM process kill
- Severity
- High
- Published
- 2 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Fixed in
- 8.0.0
- Exploit chance
- 0.5% in the next 30 daysHigher than 47% of CVEs. EPSS by FIRST, 2 Dec 2026
- Also known as
- GHSA-xm6h-2993-3ch9
- Sources
- OSV.dev and GitHub
Description
node-tar's PathReservations.getDirs() materializes every parent-directory prefix of a given path as individual strings — an O(N²) operation. The existing maxDepth guard applies only to entry.path, not to entry.linkpath. A crafted archive with a shallow entry.path and a deeply-nested linkpath bypasses the guard entirely, forcing a catastrophic heap allocation. The resulting V8 OOM is uncatchable — try/catch, Promise .catch(), and process.on('uncaughtException') all fail to intercept it. A 181-byte gzip archive is sufficient to instantly kill any Node.js process attempting extraction.
ROOT CAUSE
node-tar enforces a maxDepth=1024 segment cap on entry.path via its CHECKPATH routine. This guard is entirely absent for entry.linkpath — the target path of a symlink entry. PathReservations.reserve() unconditionally pushes entry.linkpath into its path list without any depth validation.
Affected software
| Software | Affected versions |
|---|---|
tarnpm · osv:npm:tar |
|
Status in Debian
Debian builds fixes into its own packages, so a release is often fixed under an older version number than the one upstream names.
- 4 vulnerable
| Package | Debian release | Status |
|---|---|---|
| node-tar | sidunstable | VulnerableNo fix yet. |
| 14forkytesting | VulnerableNo fix yet. | |
| 13trixiestable | VulnerableNo fix yet. | |
| 12bookwormoldstable | VulnerableNo fix yet. |
From Debian's security tracker for CVE-2026-140230 , read in the last 12 hours.
About tar
- Weekly downloads (npm)
- 113,520,680npm, 1 Dec 2026
Vulnerabilities in tar
- In our list
- 20
- Published in the last 12 months
- 20
- Critical, last 12 months
- 0
- High, last 12 months
- 19
- Known exploited
- 0
- CVE-2026-140231node-tar: Decompression within the ratio limit is buffered in memory without backpressure, and zero-size entries queue without boundHigh 2 Dec 2026
- CVE-2026-140234node-tar: Incomplete NUL-byte truncation in ustar, GNU, and PAX names causes name differentials and async crashesHigh 2 Dec 2026
- CVE-2026-140235node-tar parses PAX extended headers by newline-splitting instead of length-delimiting, causing record dropping and forged-field injectionHigh 2 Dec 2026
- CVE-2026-140236node-tar: Archive framing differential from PAX size still being applied to GNU/PAX meta entries via ReadEntry and related size/precedence inconsistenciesHigh 2 Dec 2026
- CVE-2026-140237node-tar: ReadEntry pending PAX size reapplication permits metadata-body file smugglingMedium 2 Dec 2026
- CVE-2026-140238node-tar: Newline injection in PAX extended-header records enables entry-attribute forgery (path overwrite → npm postinstall RCE on Windows)High 2 Dec 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-140230
- GitHub Advisory Database https://github.com/advisories/GHSA-xm6h-2993-3ch9