GHSA-7C32-79XJ-J3JP

Vulnerability from github – Published: 2026-12-02 01:23 – Updated: 2026-12-02 01:23
VLAI
Summary
node-tar: A small archive exhausts memory or CPU through path-reservation bookkeeping
Details

Summary

The GHSA-f5x3-32g6-xq36 fix bounded the depth (component count) of entry.path with maxDepth. The path-reservation code still computes every ancestor prefix of each reserved path, and its cost grows with the number of components multiplied by the path length. That bound doesn't apply to linkpath, nor to long components within the depth limit. Reservation state and some caches are also never released for the life of an extraction.

Details

# Issue Location Default options
VULN-002 linkpath has no depth or length bound and is reserved for every entry type. getDirs cost is quadratic in its length, so an archive of a few hundred bytes compressed aborts the Node process src/path-reservations.ts:25-38, via src/unpack.ts:729-734 Yes (async x/Unpack)
VULN-023 Within maxDepth, very long components make the same getDirs computation exhaust memory (the depth fix bounds count, not length) src/path-reservations.ts:25-38, via src/unpack.ts:734 Yes (async)
VULN-009 PathReservations.#reservations entries are never deleted, so ancestor strings for every entry are kept until the Unpack ends src/path-reservations.ts:64 Yes (async)
VULN-012 The normalizeUnicode cache is capped by entry count (10k), not bytes, so long names make it large src/normalize-unicode.ts:5-35 Yes (async)
VULN-024 filesFilter memoises every path prefix; memory grows with depth × length. The GHSA-r292 fix bounded recursion depth, not the memo src/list.ts:35-52 Needs a file list

Not the same as open PR #470, which fixes a reservation deadlock when a linkpath is a parent of the entry path.

Proof of concept

exploit_tests/test_vuln_002_*, _023_, _009_, _012_ and _024_. Each test runs a control archive and an attack archive against the unmodified 7.5.22 build, with output recorded in exploit_tests/evidence/. All were run on macOS.

Impact

Any service that extracts untrusted archives with the default async API can be made to exhaust memory or CPU, and crash, by a very small upload (VULN-002, VULN-023). The others raise memory use in long-running or large extractions.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "tar"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "8.0.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-140240"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401",
      "CWE-407",
      "CWE-770"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-12-02T01:23:10Z",
    "nvd_published_at": "2026-12-01T18:17:27Z",
    "severity": "HIGH"
  },
  "details": "### Summary\n\nThe GHSA-f5x3-32g6-xq36 fix bounded the depth (component count) of `entry.path` with `maxDepth`. The path-reservation code still computes every ancestor prefix of each reserved path, and its cost grows with the number of components multiplied by the path length. That bound doesn\u0027t apply to `linkpath`, nor to long components within the depth limit. Reservation state and some caches are also never released for the life of an extraction.\n\n\n### Details\n\n| # | Issue | Location | Default options |\n|---|---|---|---|\n| VULN-002 | `linkpath` has no depth or length bound and is reserved for every entry type. `getDirs` cost is quadratic in its length, so an archive of a few hundred bytes compressed aborts the Node process | `src/path-reservations.ts:25-38`, via `src/unpack.ts:729-734` | Yes (async `x`/`Unpack`) |\n| VULN-023 | Within `maxDepth`, very long components make the same `getDirs` computation exhaust memory (the depth fix bounds count, not length) | `src/path-reservations.ts:25-38`, via `src/unpack.ts:734` | Yes (async) |\n| VULN-009 | `PathReservations.#reservations` entries are never deleted, so ancestor strings for every entry are kept until the `Unpack` ends | `src/path-reservations.ts:64` | Yes (async) |\n| VULN-012 | The `normalizeUnicode` cache is capped by entry count (10k), not bytes, so long names make it large | `src/normalize-unicode.ts:5-35` | Yes (async) |\n| VULN-024 | `filesFilter` memoises every path prefix; memory grows with depth \u00d7 length. The GHSA-r292 fix bounded recursion depth, not the memo | `src/list.ts:35-52` | Needs a file list |\n\nNot the same as open PR #470, which fixes a reservation deadlock when a linkpath is a parent of the entry path.\n\n\n### Proof of concept\n\n`exploit_tests/test_vuln_002_*`, `_023_`, `_009_`, `_012_` and `_024_`. Each test runs a control archive and an attack archive against the unmodified 7.5.22 build, with output recorded in `exploit_tests/evidence/`. All were run on macOS.\n\n\n### Impact\n\nAny service that extracts untrusted archives with the default async API can be made to exhaust memory or CPU, and crash, by a very small upload (VULN-002, VULN-023). The others raise memory use in long-running or large extractions.",
  "id": "GHSA-7c32-79xj-j3jp",
  "modified": "2026-12-02T01:23:10Z",
  "published": "2026-12-02T01:23:10Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/isaacs/node-tar/security/advisories/GHSA-7c32-79xj-j3jp"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-140240"
    },
    {
      "type": "WEB",
      "url": "https://github.com/isaacs/node-tar/commit/73b352e0010d6c99794ea7374800816a46d3bdb2"
    },
    {
      "type": "WEB",
      "url": "https://github.com/isaacs/node-tar/commit/de87900752566867b422de0ebfe6592b30fa9786"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/isaacs/node-tar"
    },
    {
      "type": "WEB",
      "url": "https://github.com/isaacs/node-tar/releases/tag/v8.0.2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "node-tar: A small archive exhausts memory or CPU through path-reservation bookkeeping"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.