All vulnerabilities

npm

CVE-2026-140241

node-tar crashes the process with an uncaught exception on a 4-byte zstd magic header when the Node runtime lacks native zstd

Severity
High
Published
2 Dec 2026
Last changed
2 Dec 2026
Added to UpHeron
2 Dec 2026
Fixed in
8.0.0
Weakness
Uncaught exception (CWE-248)CWE-755
Also known as
GHSA-72fp-85cc-g945
Sources
OSV.dev and GitHub

Description

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.

Parser.write() sniffs the first bytes of every input and, on the zstd magic, constructs the decompressor unguarded:

minizlib's ZlibBase constructor throws TypeError: Compression method not supported: ZstdDecompress when node:zlib lacks the binding.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
tarnpm · osv:npm:tar
  • From 7.5.22 before 8.0.0

About tar

Weekly downloads (npm)
113,520,680npm, 1 Dec 2026

References