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

CVE-2026-140229: Unbounded Memory Allocation via Delayed Decompression Ratio Evaluation in node-tar

Amit Schendel
Amit Schendel
Senior Security Researcher

Dec 5, 2026·9 min read·1 visit

Executive Summary (TL;DR)

In node-tar versions prior to 8.0.0, decompression bomb protections evaluate the compression ratio only after native zlib streams allocate memory for inflated chunks, enabling denial-of-service via memory exhaustion.

CVE-2026-140229 (GHSA-9239-v992-p74f) is a denial-of-service vulnerability in the node-tar archive extraction library prior to version 8.0.0. The vulnerability occurs because the maxDecompressionRatio check is performed after the underlying zlib decompression stream has already inflated and materialized input chunks into memory. An attacker supplying a crafted, highly compressed archive can force the Node.js runtime to allocate unbounded memory buffers before the ratio limit is evaluated, terminating the process via an Out of Memory (OOM) crash.

Vulnerability Overview

node-tar (published on npm as tar) is a foundational archive extraction and creation library for the Node.js ecosystem. It is widely deployed across package managers, build pipelines, and web applications to process .tar, .tar.gz, .tar.br, and .tar.zst archives. Because it frequently processes untrusted archives uploaded by external users or fetched from remote repositories, its stream parsing and decompression pipelines represent a primary attack surface for resource exhaustion.

In a prior security update (tracked under GHSA-23hp-3jrh-7fpw), node-tar introduced the maxDecompressionRatio configuration parameter to defend against decompression bombs (also known as zip bombs or tar bombs). This mechanism was intended to track the ratio of uncompressed output bytes to compressed input bytes and abort extraction when the threshold was exceeded.

CVE-2026-140229 (GHSA-9239-v992-p74f), classified under CWE-770 (Allocation of Resources Without Limits or Throttling), identifies a structural flaw in how maxDecompressionRatio was enforced in all versions prior to 8.0.0. The ratio calculation operated reactively on emitted buffers rather than restricting the underlying decompression engine prior to buffer materialization.

When processing a compressed archive containing high-ratio deflate or brotli blocks, the native node:zlib or minizlib stream inflates the input chunk and allocates the resulting memory buffer before passing the data downstream to node-tar's ratio guard. Consequently, a compact payload can exhaust the Node.js V8 heap or system memory in a single chunk operation, crashing the host process before the abort logic executes.

Root Cause Analysis

The root cause of CVE-2026-140229 lies in the architectural decoupling between the native C++ decompression layer (node:zlib) and the JavaScript-level byte accounting in node-tar. When an application feeds a compressed byte stream into node-tar prior to version 8.0.0, the input chunks are piped directly into an underlying decompression transform stream without strict output buffer ceilings or pull-based backpressure constraints.

During synchronous or asynchronous decompression, the native zlib bindings process the provided input chunk and continuously write inflated bytes into newly allocated memory buffers. In the vulnerable implementation, node-tar registered event listeners or stream handlers that inspected the length of the decompressed buffer only after the decompression transform emitted the data event or returned from a synchronous inflate call.

Because the guard evaluated the decompressed byte count post-allocation, the protection held an implicit assumption that individual input chunks would only expand to moderately sized output buffers. An attacker violates this assumption by constructing a single compressed stream chunk (or a series of rapidly ingested chunks without backpressure) using maximum compression encoding of repeating zeroes (0x00).

Furthermore, a secondary flaw existed in how node-tar handled trailing data after reaching the logical end-of-archive (SAW_EOF). Even after the tar parser encountered the two consecutive 512-byte zero blocks signifying the end of the archive, the stream consumer continued accepting and buffering subsequent input chunks in this[BUFFER], allowing trailing garbage data in small archives to force unnecessary processing and memory retention.

Code Analysis

The remediation for CVE-2026-140229 was implemented across two commits leading up to the 8.0.0 release: 73b352e0010d6c99794ea7374800816a46d3bdb2 and da66090c7a44b2140bd4a6343c478a8e411e1aa7. Together, these patches replace the reactive post-decompression checks with pre-allocation bounds and pull-based chunk throttling.

In commit da66090c7a44b2140bd4a6343c478a8e411e1aa7, synchronous decompression routines (decompressSync) were updated to pass the calculated maximum permissible output size directly to node:zlib via the native maxOutputLength parameter. This shifts the enforcement boundary down into the Node.js C++ bindings, preventing the runtime from allocating buffers that exceed the allowed ratio:

// Calculate the native zlib ceiling based on input length and allowed ratio
const limit = (max: number) =>
  max >= constants.MAX_LENGTH ?
    {}
  : { maxOutputLength: Math.max(1, Math.floor(max)) }
 
// Enforce maxOutputLength at the C++ engine boundary during synchronous calls
decompressSync: (data, { maxOutputLength }) => {
  try {
    return decompressSync(data, limit(maxOutputLength))
  } catch (er) {
    // Intercept native C++ buffer limit exceptions and normalize the error message
    if ((er as { code?: string })?.code !== 'ERR_BUFFER_TOO_LARGE') {
      throw er
    }
    throw new Error(
      `max decompression ratio exceeded: the output is larger than ${maxOutputLength} bytes`,
    )
  }
}

For streaming pipelines, the same commit introduced a custom zlibStream wrapper around node:zlib transforms that enforces a strict 64 KiB output chunk limit (CHUNK = 64 * 1024). The stream operates on a pull-based Web Streams model, decompressing and emitting at most 64 KiB only when the downstream reader invokes pull(). This guarantees that the ratio calculation is evaluated incrementally every 64 KiB of inflated output, canceling the stream before heap exhaustion can occur.

In commit 73b352e0010d6c99794ea7374800816a46d3bdb2, the parser was modified to immediately discard incoming chunks and clear internal buffers once the end-of-archive marker (SAW_EOF) has been processed:

[CONSUMECHUNK](chunk?: Buffer) {
  // If EOF was already encountered, drop the internal buffer and ignore trailing chunks
  if (this[SAW_EOF]) {
    this[BUFFER] = undefined
    chunk = undefined
  }
  // Proceed with normal chunk parsing only if EOF has not been seen

Fix Completeness Assessment

The combination of maxOutputLength in synchronous mode and 64 KiB pull-based chunking in streaming mode resolves the CWE-770 weakness across all supported compression codecs (gzip, brotli, and zstd). Because the native node:zlib engine halts inflation immediately upon reaching maxOutputLength or filling the 64 KiB output buffer, an attacker can no longer force multi-megabyte or gigabyte allocations in a single tick. However, because this fix was shipped solely in v8.0.0—which requires Node.js 22+ and introduces breaking API changes—applications locked to the v7.x branch remain unpatched unless they implement external stream limiting.

Exploitation

Exploiting CVE-2026-140229 requires no authentication or specialized privileges on the target system, provided the application exposes an endpoint or workflow that passes user-supplied archive files to node-tar extraction functions (such as tar.x(), tar.t(), or tar.Unpack). The CVSS v4.0 vector notes UI:P (Passive User Interaction) for scenarios where a user or automated CLI utility is induced to extract an untrusted package.

To trigger the vulnerability, an attacker generates a payload consisting of a valid tar header followed by a massive stream of null bytes (0x00), compressed using gzip, brotli, or zstd at maximum compression levels. Algorithms such as Brotli and Zstandard can achieve compression ratios exceeding 1,000:1 on repetitive byte sequences, while multi-layered or Window-optimized Deflate streams can similarly compress gigabytes of zeroes into a few megabytes.

# Example conceptual generation of a high-ratio compressed tar archive
dd if=/dev/zero bs=1M count=2048 | tar -cf - --files-from=/dev/null | gzip -9 > bomb.tar.gz

When the target Node.js service ingests the crafted archive and feeds a chunk into node-tar (< 8.0.0), the following sequence occurs:

  1. The application reads a compressed chunk from disk or an HTTP request stream and writes it to the node-tar unpack stream.
  2. node-tar passes the chunk to the underlying decompressor before checking its potential expanded size.
  3. The decompressor expands the chunk in memory, attempting to allocate hundreds of megabytes or several gigabytes of contiguous Buffer space.
  4. The allocation exceeds either the Node.js buffer.constants.MAX_LENGTH ceiling or the available V8/system memory, causing an unhandled exception or an immediate fatal OOM termination (FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory).

> [!NOTE] > Proof-of-concept test cases validating this behavior are embedded directly within the isaacs/node-tar repository test suite introduced alongside the v8.0.0 commits. No standalone weaponized exploit modules have been published on ExploitDB.

Impact Assessment

The primary impact of CVE-2026-140229 is a high-severity Denial of Service (DoS) against the availability of the vulnerable Node.js process, reflected in its CVSS v4.0 base score of 7.1 (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 does not allow arbitrary code execution, memory disclosure (Confidentiality: None), or file system corruption outside of incomplete extraction prior to termination (Integrity: None).

Because Node.js operates on a single-threaded event loop architecture by default, an Out of Memory (OOM) crash or an unrecoverable native buffer exception terminates the entire Node.js worker process. In multi-tenant web servers, CI/CD runners, or package registry workers that process archive uploads in-process, a single crafted archive drops all concurrent connections handled by that instance.

Furthermore, even prior to a complete crash, rapid allocation of large native buffers triggers intensive garbage collection cycles and OS-level memory paging. This degrades CPU and I/O performance across co-located services sharing the same container or virtual machine.

As of December 2026, the Exploit Prediction Scoring System (EPSS) assigns CVE-2026-140229 a score of 0.008 (57.90th percentile), and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Automated services that blindly extract uploaded .tar.gz or .tgz archives remain the primary risk profile.

Remediation

To remediate CVE-2026-140229, upgrade the tar dependency to version 8.0.0 or later. This version incorporates the pull-based zlibStream chunking and synchronous maxOutputLength enforcement.

npm install tar@^8.0.0

> [!IMPORTANT] > Upgrading to tar@8.0.0 is a major breaking change. Version 8.0.0 drops support for older Node.js runtimes (requiring Node.js >= 22) and transitions the architecture from legacy Node.js callback streams (minipass v3/v7 style) to standard Web Streams and Promise-based APIs. Review the v8.0.0 release notes and test extraction pipelines thoroughly before deploying to production.

Workarounds for Legacy Environments (Node.js < 22 / tar v7.x)

For environments that cannot immediately migrate to Node.js 22 and tar@8.0.0, apply the following defensive controls to mitigate memory exhaustion prior to node-tar invocation:

  1. Decompress Upstream with Strict Native Limits: Instead of passing compressed streams directly into node-tar and relying on its internal decompression wrapper, pipe the input through a native node:zlib stream configured with an explicit maxOutputLength and small chunkSize (e.g., 16 * 1024), then feed the uncompressed tar stream into node-tar.
  2. Enforce Strict Input Size Quotas: Reject compressed archive uploads that exceed strict byte thresholds at the reverse proxy (e.g., Nginx client_max_body_size) or API gateway layer.
  3. Process Isolation and cgroup Limits: Execute archive extraction tasks inside isolated worker processes (child_process or worker_threads with resourceLimits) or dedicated ephemeral containers with strict cgroup memory ceilings (memory.max), ensuring that an OOM termination does not bring down the primary application server.

Official Patches

GitHub / isaacsOfficial GitHub Security Advisory GHSA-9239-v992-p74f
GitHub / isaacsnode-tar v8.0.0 Release Notes

Fix Analysis (2)

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.80%
Top 42% most exploited

Affected Systems

node-tar (npm package: tar) < 8.0.0

Affected Versions Detail

Product
Affected Versions
Fixed Version
tar (node-tar)
isaacs
< 8.0.08.0.0
AttributeDetail
CVE IDCVE-2026-140229 (GHSA-9239-v992-p74f)
Weakness ClassCWE-770: Allocation of Resources Without Limits or Throttling
CVSS v4.0 Score7.1 HIGH (AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N)
EPSS Score0.008 (57.90th percentile)
ImpactDenial of Service via V8 / Native Heap Out of Memory (OOM) Crash
Affected Versionstar (node-tar) < 8.0.0
Patched Versiontar (node-tar) 8.0.0
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-770
Allocation of Resources Without Limits or Throttling

The product allocates a resource without imposing appropriate limits on the quantity of resources that may be allocated, allowing an actor to trigger memory exhaustion or crash conditions.

Vulnerability Timeline

Fix commits (73b352e0010d6c99794ea7374800816a46d3bdb2 and da66090c7a44b2140bd4a6343c478a8e411e1aa7) committed to isaacs/node-tar
2026-11-27
GitHub Security Advisory GHSA-9239-v992-p74f and CVE-2026-140229 published
2026-12-01
NVD records CVE-2026-140229 and updates CVSS v4.0 metrics
2026-12-01
EPSS score calculated at 0.008 (57.90th percentile)
2026-12-04

References & Sources

  • [1]GitHub Security Advisory: GHSA-9239-v992-p74f
  • [2]Fix Commit: da66090c7a44b2140bd4a6343c478a8e411e1aa7
  • [3]Fix Commit: 73b352e0010d6c99794ea7374800816a46d3bdb2
  • [4]node-tar v8.0.0 Release Tag
  • [5]NVD Detail: CVE-2026-140229
  • [6]CVE.org Record: CVE-2026-140229
  • [7]CVEProject cvelistV5 JSON Record: CVE-2026-140229

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

•about 1 hour ago•CVE-2026-145366
8.2

CVE-2026-145366: Workload Identity Impersonation via ASN.1 SAN Parser Differential in Istio

CVE-2026-145366 is an ASN.1 interpretation conflict in the Istio service mesh control plane (istiod) and ambient data-plane proxy (ztunnel). When Istio is configured with an external certificate signer that copies raw Subject Alternative Name (SAN) extensions from Certificate Signing Requests (CSRs) into issued leaf certificates, a low-privileged workload can smuggle an unauthorized SPIFFE identity using non-standard ASN.1 tag classes or constructed encodings. Standard X.509 validators ignore the malformed tags during CSR authorization, while Istio re-parses the raw ASN.1 bytes and evaluates only the 5-bit tag number, enabling cross-namespace workload impersonation and extraction of TLS private keys via the Secret Discovery Service (SDS).

Alon Barad
Alon Barad
4 views•11 min read
•about 2 hours ago•CVE-2026-145367
7.7

CVE-2026-145367: Control Plane Nil Pointer Dereference and Crash-Loop DoS in Istio Ambient Mode

A denial-of-service vulnerability exists in the Istio Pilot control plane (istiod) when operating in ambient mesh mode. In versions 1.30.0 through 1.30.8, 1.31.0 through 1.31.4, and 1.32.0, creating a ServiceEntry with DNS or DNS_ROUND_ROBIN resolution attached to a waypoint proxy that resolves to zero endpoints causes buildCluster to return a nil pointer. The waypoint inbound cluster generation routine subsequently dereferences this nil pointer without validation, triggering an unhandled Go runtime panic that places all istiod replicas into a continuous crash-loop.

Amit Schendel
Amit Schendel
5 views•11 min read
•about 3 hours ago•CVE-2026-144303
7.5

CVE-2026-144303: Denial of Service via Uncaught Exception in Node.js websocket-driver

CVE-2026-144303 (GHSA-mxfr-rg9v-vp3c) is a denial-of-service vulnerability affecting the websocket-driver package for Node.js prior to version 0.8.3. When a remote client sends WebSocket frame data concatenated in the same TCP segment as the initial HTTP Upgrade request headers, applications following the documented integration pattern pass the trailing byte buffer to driver.io.write() before calling driver.start(). Because internal protocol parser states and frame reader components are not initialized until driver.start() executes, attempting to parse early frame bytes triggers an unhandled TypeError, terminating the Node.js process.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 5 hours ago•CVE-2026-137197
8.1

CVE-2026-137197: Command Injection on Windows in Node.js cross-spawn via Batch File Resolution Divergence

CVE-2026-137197 (GHSA-w3gc-668g-rf8f) is an OS command injection vulnerability (CWE-78) in the Node.js cross-spawn library affecting versions prior to 6.0.8 and 7.1.1 on Microsoft Windows. The flaw stems from parsing and resolution discrepancies between how cross-spawn identifies batch scripts (.bat and .cmd) and how Windows cmd.exe resolves target files. When a command string contains embedded double quotes, token delimiters, trailing whitespace, or relies on a child-specific PATHEXT environment variable, cross-spawn fails to detect that the target is a batch script and omits cmd.exe metacharacter escaping on user-supplied arguments, enabling arbitrary OS command execution.

Amit Schendel
Amit Schendel
8 views•13 min read
•about 9 hours ago•GHSA-6PPQ-9X26-5R92
5.3

GHSA-6ppq-9x26-5r92: Secret Retention Policy Bypass via Zero Expiry Override in Luzifer OTS

An input validation flaw in github.com/Luzifer/ots prior to version 1.21.8 allows unauthenticated remote attackers to bypass configured secret expiration policies. By supplying an expire=0 query parameter during secret creation, clients force the server to store secrets without a time-to-live (TTL) in both Redis and in-memory storage backends. This invalidates administrative data retention policies and permits unbounded storage consumption via unread secrets.

Alon Barad
Alon Barad
7 views•9 min read
•about 13 hours ago•CVE-2026-91110
6.4

CVE-2026-91110: Stored Cross-Site Scripting via URL Sanitisation Bypass in Silverstripe Framework

A stored Cross-Site Scripting (XSS) vulnerability exists in Silverstripe Framework versions prior to 6.2.13 within the HTML sanitisation engine (SilverStripe\Core\XssSanitiser). The sanitiser fails to strip or normalize non-printable ASCII C0 control characters and DEL bytes prior to evaluating URI attributes against scheme-blocking regular expressions. Because modern web browsers ignore these control bytes according to the WHATWG URL Standard, an authenticated CMS author can embed control bytes before or within a javascript: URI to bypass detection and execute arbitrary JavaScript in the browser context of users viewing the rendered content.

Alon Barad
Alon Barad
10 views•9 min read