npm
CVE-2026-140252
node-tar UnpackSync never completes sync-stream extraction after any failing entry (PEND/UNPEND imbalance)
- Severity
- High
- Published
- 1 Dec 2026
- Last changed
- 1 Dec 2026
- Added to UpHeron
- 1 Dec 2026
- Fixed in
- 8.0.0
- Also known as
- GHSA-25mm-r35j-6hgm
- Sources
- OSV.dev and GitHub
Description
When node-tar's synchronous stream extraction (tar.x({ sync: true }) without the file option, or a directly-constructed UnpackSync stream) processes any archive entry that fails, the stream never emits end, finish, or close. A single failing entry, for example a hardlink whose target does not exist (one 512-byte entry), emits a TAR_ENTRY_ERROR warning and then hangs the stream. Consumers that await stream completion hang indefinitely on hostile or merely damaged input, with no error to catch because the warning is non-fatal by design.
Unpack (async) brackets each entry's filesystem work with PEND / UNPEND to hold the stream open until every entry settles; [MAYBECLOSE] emits completion only when PENDING === 0:
UnpackSync[CHECKFS] (src/unpack.ts:901) performs the same work but never calls PEND, yet UnpackSync does not override [ONERROR], so it inherits the async handler that unconditionally calls UNPEND on any non-CwdError entry failure.
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-140252
- GitHub Advisory Database https://github.com/advisories/GHSA-25mm-r35j-6hgm