CVE-2026-140229: 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
node-tarto a version that resolves this vulnerability.Fixed in 8.0.0
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using node-tar versions before 8.0.0 are exposed when they process compressed tar input controlled by an attacker.
What does an attacker need to exploit it?
An attacker needs to supply a compressed archive whose inflation causes excessive memory allocation. Exploitation can exhaust application memory even if maxDecompressionRatio is configured.
Does configuring maxDecompressionRatio mitigate the issue in affected versions?
No. In versions before 8.0.0, the decompressed output can be allocated before node-tar evaluates the ratio limit, so the setting does not prevent the memory exhaustion condition.
What is the remediation?
Upgrade npm/tar to version 8.0.0, which fixes the issue.