CVE-2026-140252
### Summary 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. ### Details `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`: ```ts // src/unpack.ts:244-246 [MAYBECLOSE]() { if (this[ENDED] && this[PENDING] === 0) { /* emit prefinish/finish/end */ } } // src/unpack.ts:436-447 (inherited by UnpackSync) [ONERROR](er, entry) { if (er.name === 'CwdError') this.emit('error', er) else { this.warn('TAR_ENTRY_ERROR', er, { entry }); this[UNPEND](); entry.resume() } // PENDING-- } // src/unpack.ts:728-729 async CHECKFS pends... [CHECKFS](entry) { this[PEND](); ... } ``` `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. A single failing entry therefore drives `PENDING` to `-1`. Because `[MAYBECLOSE]` requires exactly `0`, the negative counter permanently suppresses `end` / `finish` / `close`. (A separate fall-through in the same method, a missing `return` after the `rmdir` branch at src/unpack.ts:953-954, double-invokes `MAKEFS` on a directory-replacement entry, producing two warnings and `PENDING = -2`.) ### PoC Validated on source main @ 2a22bfc and against the published npm package `[email protected]`, Node v24.19.0. ```js // npm i t
Properties
- Summary
- node-tar UnpackSync never completes sync-stream extraction after any failing entry (PEND/UNPEND imbalance)
- Severity
- high
- Nvd fetched at
- 2026-12-02T06:37:54.190518+00:00
- Cvss score
- 7.1
- Cvss severity
- HIGH
- Retrieved at
- 2026-12-02T06:39:20+00:00
- Ghsa published
- 2026-12-01T19:27:34Z
- Source url
- https://github.com/advisories/GHSA-25mm-r35j-6hgm
- Ghsa updated
- 2026-12-01T19:27:35Z
- Ghsa id
- GHSA-25mm-r35j-6hgm
- Last source
- GitHub Advisory Database
- Score
- 7.1
- Cvss version
- 4.0
- Cve id
- CVE-2026-140252
- Cvss vector
- CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- First seen by Signal
- 2026-12-01T22:36:00+00:00
- Name
- CVE-2026-140252
- Is ghsa only
- false
- Vector
- CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- Published at
- 2026-12-01T19:17:15.080
Related Entities (5)
HAS_WEAKNESS (3)
AFFECTS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph