HIGHCVSS v4 7.1Vulnerability

CVE-2026-140241

### Summary An unauthenticated remote-input denial of service allows a four-byte file to crash any process that lists or extracts it with node-tar's asynchronous file API, on any Node runtime without native zlib zstd support (Node 18.x, 20.x, 21.x, 22.0-22.14, 23.0-23.7, all of which satisfy the package's declared `engines: node >= 18`). node-tar's default-enabled compression sniffing detects the zstd magic (`28 b5 2f fd`) and constructs `new ZstdDecompress({})` with no error handling. On a runtime without the zstd binding, minizlib's constructor throws a `TypeError` synchronously inside the file-read stream's data callback, so the async `tar.t()` / `tar.x()` promise never settles and the exception is uncaught, killing the process. ### Details `Parser.write()` sniffs the first bytes of every input and, on the zstd magic, constructs the decompressor unguarded: ```ts // src/parse.ts:547-550 this[UNZIP] = this[UNZIP] === undefined ? new Unzip({}) : isZstd ? new ZstdDecompress({}) // throws TypeError on a runtime without native zstd : new BrotliDecompress({}) ``` `minizlib`'s `ZlibBase` constructor throws `TypeError: Compression method not supported: ZstdDecompress` when `node:zlib` lacks the binding. Because this construction runs inside the file-read stream's `data` handler (`ReadStream.emit` -> `Unpack.write` -> `new ZstdDecompress`), the throw is not routed through the stream's `error` event or `Parser.abort()`. For the async file form (`tar.x({file})` / `tar.t({file})`), the throw escapes as an uncaught exception: the process dies, and a consumer's `try/catch` or `.catch()` cannot reach it because the returned promise never settles. `zlib.ZstdDecompress` was added in Node v23.8.0 and backported to v22.15.0; on those and later runtimes the class exists and the same 4-byte input is handled through the normal catchable error path instead. ### PoC Validated on the published npm package `[email protected]` (and source main @ 2a22bfc). Vulnerable runtime: Node v20.2

Properties

Severity
high
Summary
node-tar crashes the process with an uncaught exception on a 4-byte zstd magic header when the Node runtime lacks native zstd
Nvd fetched at
2026-12-02T06:37:54.190518+00:00
Cvss severity
HIGH
Cvss score
7.1
Retrieved at
2026-12-02T06:39:20+00:00
Ghsa published
2026-12-02T01:15:55Z
Source url
https://github.com/advisories/GHSA-72fp-85cc-g945
Ghsa updated
2026-12-02T01:15:57Z
Ghsa id
GHSA-72fp-85cc-g945
Last source
GitHub Advisory Database
Score
7.1
Cvss version
4.0
Cve id
CVE-2026-140241
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-01T18:35:21+00:00
Name
CVE-2026-140241
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-01T18:17:28.147

Related Entities (4)

HAS_WEAKNESS (2)

AFFECTS (1)

→[Software]npm/tar

VULNERABLE_TO (1)

←[Software]npm/tar

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-140241 (CVSS v4 7.1) — Ninja Signal Threat Intelligence | Ninja Signal