Dec 2, 2026·11 min read·6 visits
Versions of node-tar prior to 8.0.0 fail to apply stream backpressure during archive decompression and allow unbounded queuing of zero-size entries in memory. Processing a maliciously crafted archive causes rapid heap exhaustion and application termination via an Out-of-Memory crash, even when the archive adheres to the configured maxDecompressionRatio limit.
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.
node-tar (published as tar on npm) is a core archive manipulation library within the Node.js ecosystem. It provides asynchronous and synchronous interfaces for creating, listing, and extracting tar archives, supporting transparent decompression for gzip, brotli, and zstd formats. Because node-tar is frequently integrated into package managers, build pipelines, and file upload endpoints that ingest external archives, its parsing engine represents a direct attack surface for untrusted binary inputs.
In versions of node-tar prior to 8.0.0, the streaming decompression and tar block parsing pipeline contains a resource allocation vulnerability classified under CWE-770 (Allocation of Resources Without Limits or Throttling) and CWE-409 (Improper Handling of Highly Compressed Data). When processing a compressed archive stream, the library inflates compressed chunks synchronously and buffers the resulting data and entry metadata in memory without verifying whether the downstream consumer has consumed prior entries.
In a prior release (v7.5.19), node-tar introduced a maxDecompressionRatio configuration property (defaulting to a 1000:1 ratio) to defend against classic archive decompression bombs. However, CVE-2026-140231 circumvents this control. By constructing an archive whose overall decompression ratio stays within the allowed threshold—or by packing hundreds of thousands of consecutive 512-byte zero-size headers—an attacker can force node-tar to instantiate millions of JavaScript objects and buffer unconsumed stream chunks within a single synchronous execution tick.
When a vulnerable application attempts to extract (tar.x) or list (tar.t) such an archive, the Node.js V8 heap and resident set size (RSS) expand uncontrollably. Because no backpressure signal is propagated back to the decompressor or input stream, the process rapidly exceeds its configured heap limit and terminates with a fatal Out-of-Memory (OOM) error, resulting in a complete denial of service for the Node.js runtime.
The root cause of CVE-2026-140231 lies in the push-based synchronous event loop coupling between the decompressor (minizlib), the tar block parser (Parser), and the entry representation streams (ReadEntry) in node-tar v7 and earlier. The parser relies on Minipass streams, which favor synchronous execution and in-memory buffering when downstream consumers are paused.
First, the maxDecompressionRatio guard implemented in src/parse.ts only evaluates cumulative byte volume across the lifetime of the stream. In the [CHECKDECOMPRESSIONRATIO] method, the parser adds the length of each newly inflated chunk to this[DECOMPRESSEDBYTESREAD] and divides it by this[COMPRESSEDBYTESREAD]. If the cumulative ratio remains below 1000, the check passes. This check has no awareness of how many bytes or objects are currently resident in memory awaiting downstream consumption.
Second, when a compressed input chunk is written to this[UNZIP].write(chunk), the underlying decompressor (minizlib.Unzip, BrotliDecompress, or ZstdDecompress) inflates the payload synchronously and emits 'data' events in a tight loop. Each emitted chunk immediately triggers this[CONSUMECHUNK](chunk), which delegates body blocks to this[CONSUMEBODY]. In src/read-entry.ts, every ReadEntry instance is explicitly initialized in a paused state (this.pause()) inside its constructor. When [CONSUMEBODY] calls entry.write(chunk) on a paused ReadEntry before the application or filesystem writer has drained it, Minipass buffers the entire uncompressed payload in memory without signaling the decompressor to halt inflation.
Third, the parser exhibits severe amplification when processing zero-size archive entries (size = 0, such as empty files or directory headers). In the tar specification, a zero-size entry consists solely of a single 512-byte header block with no subsequent body blocks. When [CONSUMEHEADER] processes a 512-byte header in src/parse.ts, it instantiates a Header object and a ReadEntry object, immediately pushing the entry into the internal queue (this[QUEUE]). Because a sequence of 250,000 identical or similar 512-byte headers represents only 128 MB of uncompressed data, it easily satisfies the maxDecompressionRatio check, yet instantiating 250,000 full Header and ReadEntry stream objects in a single synchronous loop consumes multiple gigabytes of V8 heap space before this[QUEUE] can be drained.
In node-tar prior to 8.0.0, the vulnerable code paths reside primarily in src/parse.ts and src/read-entry.ts. The following snippet from src/parse.ts illustrates how the ratio check and synchronous data listener operated without flow control:
// Vulnerable code in src/parse.ts (node-tar < 8.0.0)
[CHECKDECOMPRESSIONRATIO](chunk: Buffer) {
this[DECOMPRESSEDBYTESREAD] += chunk.length
const ratio = this[DECOMPRESSEDBYTESREAD] / this[COMPRESSEDBYTESREAD]
if (ratio > this.maxDecompressionRatio) {
this.abort(new Error(`max decompression ratio exceeded: ...`))
return false
}
return true
}
// Inside the unzip setup in src/parse.ts:
this[UNZIP].on('data', chunk => {
// Fires synchronously for all inflated output from a single compressed input chunk.
// No check is performed to verify if this[QUEUE] is full or if current entry is paused.
if (this[CHECKDECOMPRESSIONRATIO](chunk)) {
this[CONSUMECHUNK](chunk)
}
})Simultaneously, src/read-entry.ts forced every newly created entry into a paused state, ensuring that any data written to it prior to downstream attachment or resumption accumulated in an internal array:
// Vulnerable initialization in src/read-entry.ts (node-tar < 8.0.0)
export class ReadEntry extends Minipass<Buffer, Buffer> {
constructor(header: Header, ex?: Pax, gex?: Pax) {
super({})
// Entry starts paused; writes to this entry buffer in RAM until resumed
this.pause()
this.header = header
// ...
}
}To remediate CVE-2026-140231, commit da66090c7a44b2140bd4a6343c478a8e411e1aa7 (released in node-tar 8.0.0) replaced the legacy Minipass architecture with a pull-based streaming design built on standard Web Streams (ReadableStream and WritableStream) and a demand-driven state machine. In src/next/node/codecs.ts, decompression is now bounded to 64 KiB chunks (CHUNK = 64 * 1024) and pauses immediately after emitting a single chunk until the downstream reader explicitly invokes pull():
// Patched pull-based decompression in src/next/node/codecs.ts (node-tar 8.0.0)
const CHUNK = 64 * 1024
export const zlibStream = (
stream: Transform,
batch: boolean = false,
first?: (chunk: Uint8Array) => void,
): CodecStream => {
let wanted = false
let done = false
let wake: (() => void) | undefined
// Start underlying transform stream in a paused state
stream.pause()
stream.on('data', (chunk: Uint8Array) => {
first?.(chunk)
first = undefined
wanted = false
// Immediately pause after receiving a single chunk to enforce backpressure
stream.pause()
output.enqueue(chunk)
})
return {
readable: new ReadableStream<Uint8Array>({
pull: () => {
// Only resume inflation when downstream consumer requests data
wanted = true
wake?.()
stream.resume()
},
cancel: reason => { /* cleanup */ }
}, { highWaterMark: 0 }),
writable: new WritableStream<Uint8Array>({
write: async chunk => {
// Block further writes if the reader has not requested data
if (!wanted && !done) await new Promise<void>(res => (wake = res))
}
})
}
}In addition to the streaming overhaul, node-tar 8.0.0 completely removed the unbounded this[QUEUE] array from Parser, converting the parser into a synchronous state machine where entries are yielded one at a time via parser.next(). Furthermore, for synchronous extraction operations (extractSync, listSync), the patch passes maxOutputLength directly to Node.js native node:zlib bindings, ensuring that oversized payloads trigger ERR_BUFFER_TOO_LARGE at the C++ binding layer before memory allocation occurs. This architectural redesign completely eliminates both the unbounded buffer growth and the zero-size entry object flood.
Exploiting CVE-2026-140231 requires no authentication or specialized environmental configurations beyond an application endpoint or CLI workflow that passes user-supplied archive files to node-tar functions such as tar.extract (tar.x), tar.list (tar.t), or the tar.Parse stream constructor. Both network-facing services (such as package registries, CI/CD artifact processors, or web upload handlers) and local automated tools are susceptible.
To construct a proof-of-concept archive that bypasses maxDecompressionRatio while maximizing V8 heap object overhead, an attacker generates a gzip-compressed tar archive containing hundreds of thousands of consecutive zero-size file headers. Each header occupies 512 bytes in the uncompressed tar stream. Because the headers contain repetitive metadata and null padding, gzip compresses 250,000 headers (128 MB uncompressed) down to a few hundred kilobytes or a few megabytes. If necessary, the attacker can pad the compressed file slightly so that the ratio of uncompressed bytes (128 MB) to compressed bytes remains strictly below the 1000:1 maxDecompressionRatio threshold.
# Proof-of-Concept Generator: Creates an archive with 250,000 zero-size entries
import tarfile
with tarfile.open('poc_oom.tar.gz', 'w:gz') as tar:
for i in range(250000):
ti = tarfile.TarInfo(name=f'entry_{i}.txt')
ti.size = 0
tar.addfile(ti)When the target application processes poc_oom.tar.gz using node-tar versions prior to 8.0.0, even a minimal listing operation with a no-op callback triggers the vulnerability:
const tar = require('tar');
// Vulnerable execution in node-tar < 8.0.0
tar.t({
file: 'poc_oom.tar.gz',
onentry: entry => {
// Even with a no-op handler, Parser queues hundreds of thousands
// of Header and ReadEntry objects synchronously in memory.
}
});Upon execution, this[UNZIP] inflates the compressed stream in large chunks and invokes [CONSUMEHEADER] hundreds of thousands of times without yielding back to the stream consumer or pausing the input file reader. Resident memory climbs past the V8 default heap limit (typically 1.5 GB to 4 GB depending on the Node.js version and architecture), culminating in an unrecoverable process crash (FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory).
The primary security impact of CVE-2026-140231 is a high-severity Denial of Service (DoS) affecting application availability. The vulnerability is assigned a CVSS v4.0 base score of 7.1 (High) with the 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 attack vector is Network (AV:N) with Low attack complexity (AC:L), no attack requirements (AT:N), and no required privileges (PR:N), requiring only passive user or system interaction (UI:P) to process the archive.
In a single-process Node.js architecture, an unhandled V8 Out-of-Memory error cannot be caught by standard JavaScript try/catch blocks or process.on('uncaughtException') handlers. When the V8 engine exhausts its heap allocation, it immediately aborts the OS process via abort(). Consequently, any concurrent HTTP requests, background jobs, or active WebSocket connections hosted by the same Node.js process are terminated abruptly.
In containerized environments (such as Kubernetes pods or Docker containers configured with cgroup memory limits), the rapid allocation of unconsumed Minipass buffers and ReadEntry instances triggers the Linux kernel OOM Killer (SIGKILL / exit code 137) before V8 garbage collection can reclaim memory. If an attacker repeatedly submits crafted archives to an auto-restarting service, the application enters a continuous CrashLoopBackOff state, rendering the service persistently unavailable.
Confidentiality (VC:N) and integrity (VI:N) are not directly impacted, as the vulnerability does not allow out-of-bounds memory reads or arbitrary code execution. According to FIRST.org telemetry, the vulnerability carries an EPSS score of 0.00647 (52.37th percentile) and is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
To fully remediate CVE-2026-140231, upgrade node-tar (tar) to version 8.0.0 or later. Version 8.0.0 replaces the vulnerable push-based parser with a pull-based Web Streams implementation that enforces a strict 64 KiB chunk window (highWaterMark: 0), pauses decompression after each chunk until downstream drain occurs, and enforces maxOutputLength on synchronous decompression operations.
npm install tar@^8.0.0> [!NOTE]
> Upgrading to node-tar 8.0.0 introduces breaking API and runtime changes. Version 8.0.0 requires Node.js 22 or higher, replaces Minipass streams and callback patterns with native Promises, Web ReadableStream interfaces, and async iterables, and removes single-letter command/option aliases (x, t, c, f, C, z). Engineering teams should review the v8.0.0 release notes and update stream integration points accordingly.
For environments locked to older Node.js runtimes (< 22) that cannot immediately migrate to node-tar 8.0.0, defense-in-depth mitigations must be implemented around archive ingestion paths:
client_max_body_size in NGINX) to constrain the total compressed payload size an attacker can submit.node-tar extraction or listing directly inside the primary Node.js event loop handling user traffic. Offload archive operations to a dedicated child process (child_process.fork or spawn) configured with explicit V8 heap constraints (--max-old-space-size=256) or an isolated container with hard cgroup memory limits, ensuring that an OOM crash only terminates the ephemeral worker.onentry or filter callback and calling parser.abort() if an archive exceeds a defined maximum entry threshold (e.g., 10,000 entries).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| Product | Affected Versions | Fixed Version |
|---|---|---|
node-tar (tar) isaacs | < 8.0.0 | 8.0.0 |
| Attribute | Detail |
|---|---|
| CVE ID | CVE-2026-140231 (GHSA-9hmx-4f52-v64x) |
| Weakness Class | CWE-770 (Allocation of Resources Without Limits) / CWE-409 (Data Amplification) |
| CVSS v4.0 Score | 7.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 Score | 0.65% (52.37th Percentile) |
| Attack Vector | Network (Crafted compressed tar archive with high chunk expansion or zero-size headers) |
| Impact | Denial of Service via Uncontrolled V8 Heap Exhaustion (OOM Crash) |
| Exploit Status | Proof of Concept (Trivial to reproduce via tarfile generation) |
| Patched Version | node-tar 8.0.0 |
The software allocates memory buffers and queues entry objects without imposing an upper limit or enforcing backpressure against unconsumed data, alongside improper handling of highly compressed data (CWE-409).
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.
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.
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.
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.
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.
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.