node-tar maxDecompressionRatio bypass — DoS via zstd/brotli decompression bombs (CVE-2026-140229)
Severity: high · Patch status: patched · Since 2026-11-28 · CVE-2026-140229
node-tar (the npm package tar) before 8.0.0 checks decompressed size against maxDecompressionRatio only after Node's zlib has already inflated the data, so the guard added for GHSA-23hp-3jrh-7fpw does not actually bound memory. Input is auto-detected as zstd by default, and zstd and brotli expand far beyond the 1000:1 ratio the check was tuned for on gzip, so a small archive can expand inside one decompression call. A third path keeps buffering data after the tar end-of-archive marker. The reporter's advisory describes a 65,608-byte zstd archive that expands to 2 GiB and OOM-kills a Node process in a 512 MB container at default options; that is the reporter's claim, which we did not reproduce. Any service that passes untrusted archives to tar.t() or tar.x() (registries, CI runners, artifact or backup services) is exposed to denial of service. The advisory describes no code execution or data access. Version 8.0.0 is the fix and the GitHub advisory lists GHSA-9239-v992-p74f as fixed in that release. We found no reported in-the-wild exploitation, and the flaw is not in the CISA KEV catalog.
What to do
- Upgrade npm tar to 8.0.0 or later (8.1.3 is the current npm release at research time). Note that 8.0.0 is a breaking major release: it drops Node < 22 and removes the callback and Node stream API, so plan the upgrade rather than bumping blindly
- Audit services that parse attacker-supplied archives (registries, CI runners, artifact and backup services) for any call to tar.t(), tar.x() or entries() on untrusted input
- Run archive-parsing services with memory limits and process isolation so an out-of-memory kill stays contained
- Track the sibling node-tar advisories in the portal's node-tar symlink-escape record, which list fixes in later 8.0.x releases; this record's 8.0.0 fix does not cover them
Fixed versions
Sources
All live incidents on Threat Watch