npm
CVE-2026-140240
node-tar: A small archive exhausts memory or CPU through path-reservation bookkeeping
- Severity
- High
- Published
- 2 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Fixed in
- 8.0.2
- Weakness
- Memory leak (CWE-401)Inefficient algorithmic complexity (CWE-407)Allocation without limits (CWE-770)
- Also known as
- GHSA-7c32-79xj-j3jp
- Sources
- OSV.dev and GitHub
Description
The GHSA-f5x3-32g6-xq36 fix bounded the depth (component count) of entry.path with maxDepth. The path-reservation code still computes every ancestor prefix of each reserved path, and its cost grows with the number of components multiplied by the path length. That bound doesn't apply to linkpath, nor to long components within the depth limit. Reservation state and some caches are also never released for the life of an extraction.
Not the same as open PR #470, which fixes a reservation deadlock when a linkpath is a parent of the entry path.
Any service that extracts untrusted archives with the default async API can be made to exhaust memory or CPU, and crash, by a very small upload (VULN-002, VULN-023). The others raise memory use in long-running or large extractions.
Affected software
| Software | Affected versions |
|---|---|
tarnpm · osv:npm:tar |
|
About tar
- Weekly downloads (npm)
- 113,520,680npm, 1 Dec 2026
Vulnerabilities in tar
- In our list
- 18
- Published in the last 12 months
- 18
- Critical, last 12 months
- 0
- High, last 12 months
- 17
- Known exploited
- 0
- 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
- CVE-2026-140239node-tar: Global PAX extended header injects attacker-controlled linkpath into tar.Parser entries, bypassing strict-mode validationHigh 2 Dec 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-140240
- GitHub Advisory Database https://github.com/advisories/GHSA-7c32-79xj-j3jp