CVE-2026-140231: node-tar Decompression Within The Ratio Limit Vulnerability

HIGH
Advisory Identifier: GHSA-9hmx-4f52-v64x
CWE-409 CWE-770
Published
Advisory Summary

CVE-2026-140231 is a HIGH decompression within the ratio limit vulnerability (CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)) affecting node-tar libraries in the npm ecosystem. The issue involves decompression within the ratio limit is buffered in memory without backpressure, and zero-size entries queue without bound. Remediation is available by upgrading affected packages to version 8.0.0.

CVE-2026-140231 at a Glance

CVE Identifier CVE-2026-140231
GHSA Identifier GHSA-9hmx-4f52-v64x
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected Product node-tar
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-140231

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.

tar fixed: 8.0.0
npm install tar@8.0.0
Verify Direct and Transitive Dependencies

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-140231, 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 8.0.0), 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-409: Improper Handling of Highly Compressed Data (Data Amplification), where the product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output. 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

### Summary The GHSA-23hp-3jrh-7fp fix (7.5.19, commit 2812e93) aborts when the total decompressed size exceeds `maxDecompressionRatio` times the compressed size. That limits total work, not how much is held in memory at once. When reading from a file, each read chunk is inflated synchronously and its output is buffered in a paused `ReadEntry`, so memory use isn't bounded while staying under the ratio. In the same write, zero-size entries are queued without any limit. ### Details | # | Location | Default options | |---|---|---| | VULN-008 | `src/parse.ts:576-577, 551-555, 343` → `src/read-entry.ts:131` | Yes (`x({file})`, `t({file})`) | | VULN-011 | `src/parse.ts:268-273` (same root cause) | Yes | ### Proof of concept `exploit_tests/test_vuln_008_*` and `_011_` measure memory for a control archive and an attack archive against the unmodified 7.5.22 build. Output is in `exploit_tests/evidence/`. The tests were run on macOS. ### Impact A service that extracts or lists untrusted compressed archives can be made to use much more memory than the archive size suggests, without hitting the ratio limit. ### Suggested fix Queue compressed input and inflate in small slices only while consumers aren't paused, and stop accepting zero-size entries while the queue is non-empty. One patch covering both was validated on a copy of the source (`fixes/VULN-008.diff`). **Versions:** tested on 7.5.22 (main @ 2a22bfc). 7.5.23 changes only the publishing workflow (no `src/` changes), so it is affected too. ### Reproduction bundle A bundle with the tests, recorded evidence and proposed fix diffs for this report is ready. This form takes no attachments, so I'll add it to the temporary private fork, or send it however you prefer.

CVE-2026-140231 Affected node-tar Versions

1 component(s)
Fixed Versions:
8.0.0
Product / Package Ecosystem Affected Versions Fixed Version
tar
npm
< 8.0.0
8.0.0

References

Frequently Asked Questions

What is CVE-2026-140231?
CVE-2026-140231 is a security vulnerability in node-tar involving Decompression within the ratio limit is buffered in memory without backpressure, and zero-size entries queue without bound under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification).
Which node-tar versions are affected?
Affected versions include releases prior to 8.0.0 across affected packages: tar.
What version fixes CVE-2026-140231?
Upgrading to 8.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tar affected?
Yes, tar is affected in releases prior to 8.0.0. Upgrade your dependency to 8.0.0 or later.
What CWE is associated with CVE-2026-140231?
CVE-2026-140231 is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification) (The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.).
How can I check npm dependencies for CVE-2026-140231?
Run the dependency tree command: 'npm ls tar'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9hmx-4f52-v64x",
  "modified" : "2026-12-02T18:28:28Z",
  "published" : "2026-12-02T18:28:28Z",
  "aliases" : [ "CVE-2026-140231" ],
  "summary" : "node-tar: Decompression within the ratio limit is buffered in memory without backpressure, and zero-size entries queue without bound",
  "details" : "### Summary\n\nThe GHSA-23hp-3jrh-7fp fix (7.5.19, commit 2812e93) aborts when the total decompressed size exceeds `maxDecompressionRatio` times the compressed size. That limits total work, not how much is held in memory at once. When reading from a file, each read chunk is inflated synchronously and its output is buffered in a paused `ReadEntry`, so memory use isn't bounded while staying under the ratio. In the same write, zero-size entries are queued without any limit.\n\n### Details\n\n| # | Location | Default options |\n|---|---|---|\n| VULN-008 | `src/parse.ts:576-577, 551-555, 343` → `src/read-entry.ts:131` | Yes (`x({file})`, `t({file})`) |\n| VULN-011 | `src/parse.ts:268-273` (same root cause) | Yes |\n\n### Proof of concept\n\n`exploit_tests/test_vuln_008_*` and `_011_` measure memory for a control archive and an attack archive against the unmodified 7.5.22 build. Output is in `exploit_tests/evidence/`. The tests were run on macOS.\n\n### Impact\n\nA service that extracts or lists untrusted compressed archives can be made to use much more memory than the archive size suggests, without hitting the ratio limit.\n\n### Suggested fix\n\nQueue compressed input and inflate in small slices only while consumers aren't paused, and stop accepting zero-size entries while the queue is non-empty. One patch covering both was validated on a copy of the source (`fixes/VULN-008.diff`).\n\n**Versions:** tested on 7.5.22 (main @ 2a22bfc). 7.5.23 changes only the publishing workflow (no `src/` changes), so it is affected too.\n\n### Reproduction bundle\n\nA bundle with the tests, recorded evidence and proposed fix diffs for this report is ready. This form takes no attachments, so I'll add it to the temporary private fork, or send it however you prefer.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tar"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/isaacs/node-tar/security/advisories/GHSA-9hmx-4f52-v64x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-140231"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/isaacs/node-tar/commit/da66090c7a44b2140bd4a6343c478a8e411e1aa7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/isaacs/node-tar"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/isaacs/node-tar/releases/tag/v8.0.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-409", "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-02T18:28:28Z",
    "nvd_published_at" : "2026-12-01T17:17:35Z"
  }
}