GHSA-98V3-7XJR-FG83
Vulnerability from github – Published: 2026-12-02 00:50 – Updated: 2026-12-02 00:50Summary
An unauthenticated remote-input denial of service allows a crafted tar archive of about 1.5 KB to permanently and silently hang node-tar's default asynchronous extraction. When a Link or SymbolicLink entry has a linkpath that is an ancestor (or descendant) directory of the entry's own path, the internal path-reservation queue enters an unsatisfiable state. The promise returned by tar.x() / tar.extract() never resolves or rejects, the stream never emits end / finish / close, and no warning is raised. Every entry after the poison entry is silently skipped.
Details
Async Unpack serialises filesystem work through PathReservations (src/path-reservations.ts). reserve([entry.path, entry.linkpath], fn) registers each reserved path as a plain function at that path's queue key, and every ancestor directory of each path as a Set<Handler> at that directory's queue key.
check(fn) (src/path-reservations.ts:114-120) only schedules fn when it is the head function of every path queue AND the head of every directory queue is a Set that contains fn:
check(fn) {
const { paths, dirs } = this.#getQueues(fn)
return (
paths.every(q => q && q[0] === fn) &&
dirs.every(q => q && q[0] instanceof Set && q[0].has(fn))
)
}
When one of the two reserved strings is an ancestor directory of the other, the same queue key is written twice: once as a function head (the path reservation, src/path-reservations.ts:65-72) and once as a directory Set (the dir reservation, src/path-reservations.ts:73-85). For a hardlink a/b whose linkpath is a, key a first receives [fn] (function head), then the dir loop appends a Set behind it, giving [fn, Set([fn])]. check() then requires q[0] instanceof Set at key a, but q[0] is the function fn, so check() is permanently false. #run(fn) never fires, [CHECKFS2] never executes, the [PENDING] counter never drains, and [MAYBECLOSE] never completes the stream.
The collision can be introduced by three independent, attacker-controlled routes, all validated:
1. A literal Link / SymbolicLink header whose linkpath is a hierarchical relative of its path.
2. A PAX extended-header linkpath record attached to a plain File entry (the "linkpath forbidden" check runs on the raw header before PAX fields are applied, so a File can carry a linkpath). See advisory 03.
3. A GNU long-linkname (K / NextFileHasLongLinkpath) entry assigning a hierarchical linkpath to the following link entry.
Synchronous extraction bypasses reservations and is unaffected. Windows is unaffected because reservations are globally serialised there under a single key ('win32 parallelization disabled', src/path-reservations.ts:53-55).
PoC
Validated on president-xd/node-tar main @ 2a22bfc (version 7.5.22) and against the published npm package tar@7.5.22, on Linux, 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/resv-hang'; fs.rmSync(dir, {recursive:true, force:true}); fs.mkdirSync(dir, {recursive:true})
const b = Buffer.alloc(512)
new Header({ path: 'a/b', type: 'Link', linkpath: 'a', size: 0, mode: 0o644 }).encode(b, 0) // linkpath 'a' is ancestor of 'a/b'
fs.writeFileSync(dir + '/poison.tar', Buffer.concat([b, Buffer.alloc(1024)]))
let settled = 'NEVER'
x({ cwd: dir, file: dir + '/poison.tar' }).then(() => settled='RESOLVED').catch(() => settled='REJECTED')
const keepalive = setInterval(() => {}, 100) // hold the loop open so an unsettled promise is a true hang
setTimeout(() => { clearInterval(keepalive); console.log('result:', settled); process.exit(0) }, 4000)
Observed output:
result: NEVER // no warning, no resolution, no rejection
Control archive with linkpath: 'c' (a sibling, not a hierarchical relative) resolves in the same harness with a single TAR_ENTRY_ERROR warning. The PAX-linkpath route (14 linkpath=a\n before a File at a/b) and the GNU K route both hang identically; their sibling controls both resolve.
Impact
Availability-only denial of service (no confidentiality or integrity effect, no extraction outside the target directory). Any pipeline that uses node-tar's default asynchronous extraction on POSIX and awaits completion can be wedged forever by a small crafted archive: npm and CI package installation, artifact processing, bundlers, and any service that extracts third-party tarballs. Impact is a permanent silent hang, with all subsequent entries in the archive never extracted. Unauthenticated, remote, no user interaction.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "tar"
},
"ranges": [
{
"events": [
{
"introduced": "7.5.22"
},
{
"fixed": "8.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-140251"
],
"database_specific": {
"cwe_ids": [
"CWE-667",
"CWE-833"
],
"github_reviewed": true,
"github_reviewed_at": "2026-12-02T00:50:20Z",
"nvd_published_at": "2026-12-01T19:17:14Z",
"severity": "HIGH"
},
"details": "### Summary\nAn unauthenticated remote-input denial of service allows a crafted tar archive of about 1.5 KB to permanently and silently hang node-tar\u0027s default asynchronous extraction. When a `Link` or `SymbolicLink` entry has a `linkpath` that is an ancestor (or descendant) directory of the entry\u0027s own `path`, the internal path-reservation queue enters an unsatisfiable state. The promise returned by `tar.x()` / `tar.extract()` never resolves or rejects, the stream never emits `end` / `finish` / `close`, and no warning is raised. Every entry after the poison entry is silently skipped.\n\n### Details\nAsync `Unpack` serialises filesystem work through `PathReservations` (`src/path-reservations.ts`). `reserve([entry.path, entry.linkpath], fn)` registers each reserved path as a plain function at that path\u0027s queue key, and every ancestor directory of each path as a `Set\u003cHandler\u003e` at that directory\u0027s queue key.\n\n`check(fn)` (src/path-reservations.ts:114-120) only schedules `fn` when it is the head function of every path queue AND the head of every directory queue is a `Set` that contains `fn`:\n\n```ts\ncheck(fn) {\n const { paths, dirs } = this.#getQueues(fn)\n return (\n paths.every(q =\u003e q \u0026\u0026 q[0] === fn) \u0026\u0026\n dirs.every(q =\u003e q \u0026\u0026 q[0] instanceof Set \u0026\u0026 q[0].has(fn))\n )\n}\n```\n\nWhen one of the two reserved strings is an ancestor directory of the other, the same queue key is written twice: once as a function head (the path reservation, src/path-reservations.ts:65-72) and once as a directory `Set` (the dir reservation, src/path-reservations.ts:73-85). For a hardlink `a/b` whose linkpath is `a`, key `a` first receives `[fn]` (function head), then the dir loop appends a `Set` behind it, giving `[fn, Set([fn])]`. `check()` then requires `q[0] instanceof Set` at key `a`, but `q[0]` is the function `fn`, so `check()` is permanently false. `#run(fn)` never fires, `[CHECKFS2]` never executes, the `[PENDING]` counter never drains, and `[MAYBECLOSE]` never completes the stream.\n\nThe collision can be introduced by three independent, attacker-controlled routes, all validated:\n1. A literal `Link` / `SymbolicLink` header whose `linkpath` is a hierarchical relative of its `path`.\n2. A PAX extended-header `linkpath` record attached to a plain `File` entry (the \"linkpath forbidden\" check runs on the raw header before PAX fields are applied, so a File can carry a linkpath). See advisory 03.\n3. A GNU long-linkname (`K` / `NextFileHasLongLinkpath`) entry assigning a hierarchical linkpath to the following link entry.\n\nSynchronous extraction bypasses reservations and is unaffected. Windows is unaffected because reservations are globally serialised there under a single key (`\u0027win32 parallelization disabled\u0027`, src/path-reservations.ts:53-55).\n\n### PoC\nValidated on `president-xd/node-tar` main @ 2a22bfc (version 7.5.22) and against the published npm package `tar@7.5.22`, on Linux, Node v24.19.0.\n\n```js\n// npm i tar@7.5.22 ; node poc.cjs\nconst { Header, x } = require(\u0027tar\u0027)\nconst fs = require(\u0027fs\u0027)\nconst dir = \u0027/tmp/resv-hang\u0027; fs.rmSync(dir, {recursive:true, force:true}); fs.mkdirSync(dir, {recursive:true})\nconst b = Buffer.alloc(512)\nnew Header({ path: \u0027a/b\u0027, type: \u0027Link\u0027, linkpath: \u0027a\u0027, size: 0, mode: 0o644 }).encode(b, 0) // linkpath \u0027a\u0027 is ancestor of \u0027a/b\u0027\nfs.writeFileSync(dir + \u0027/poison.tar\u0027, Buffer.concat([b, Buffer.alloc(1024)]))\nlet settled = \u0027NEVER\u0027\nx({ cwd: dir, file: dir + \u0027/poison.tar\u0027 }).then(() =\u003e settled=\u0027RESOLVED\u0027).catch(() =\u003e settled=\u0027REJECTED\u0027)\nconst keepalive = setInterval(() =\u003e {}, 100) // hold the loop open so an unsettled promise is a true hang\nsetTimeout(() =\u003e { clearInterval(keepalive); console.log(\u0027result:\u0027, settled); process.exit(0) }, 4000)\n```\n\nObserved output:\n```\nresult: NEVER // no warning, no resolution, no rejection\n```\nControl archive with `linkpath: \u0027c\u0027` (a sibling, not a hierarchical relative) resolves in the same harness with a single `TAR_ENTRY_ERROR` warning. The PAX-linkpath route (`14 linkpath=a\\n` before a `File` at `a/b`) and the GNU `K` route both hang identically; their sibling controls both resolve.\n\n### Impact\nAvailability-only denial of service (no confidentiality or integrity effect, no extraction outside the target directory). Any pipeline that uses node-tar\u0027s default asynchronous extraction on POSIX and awaits completion can be wedged forever by a small crafted archive: npm and CI package installation, artifact processing, bundlers, and any service that extracts third-party tarballs. Impact is a permanent silent hang, with all subsequent entries in the archive never extracted. Unauthenticated, remote, no user interaction.",
"id": "GHSA-98v3-7xjr-fg83",
"modified": "2026-12-02T00:50:20Z",
"published": "2026-12-02T00:50:20Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/security/advisories/GHSA-98v3-7xjr-fg83"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-140251"
},
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/commit/73b352e0010d6c99794ea7374800816a46d3bdb2"
},
{
"type": "PACKAGE",
"url": "https://github.com/isaacs/node-tar"
},
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/releases/tag/v8.0.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "node-tar async extraction deadlocks permanently when an entry\u0027s linkpath is a hierarchical relative of its own path"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.