All vulnerabilities

npm

CVE-2026-140230

node-tar PathReservations.getDirs() quadratic memory amplification via unbounded symlink linkpath depth — uncatchable OOM process kill

Severity
High
Published
2 Dec 2026
Last changed
2 Dec 2026
Added to UpHeron
2 Dec 2026
Fixed in
8.0.0
Exploit chance
0.5% in the next 30 daysHigher than 47% of CVEs. EPSS by FIRST, 2 Dec 2026
Weakness
Uncontrolled resource consumption (CWE-400)
Also known as
GHSA-xm6h-2993-3ch9
Sources
OSV.dev and GitHub

Description

node-tar's PathReservations.getDirs() materializes every parent-directory prefix of a given path as individual strings — an O(N²) operation. The existing maxDepth guard applies only to entry.path, not to entry.linkpath. A crafted archive with a shallow entry.path and a deeply-nested linkpath bypasses the guard entirely, forcing a catastrophic heap allocation. The resulting V8 OOM is uncatchable — try/catch, Promise .catch(), and process.on('uncaughtException') all fail to intercept it. A 181-byte gzip archive is sufficient to instantly kill any Node.js process attempting extraction.

ROOT CAUSE

node-tar enforces a maxDepth=1024 segment cap on entry.path via its CHECKPATH routine. This guard is entirely absent for entry.linkpath — the target path of a symlink entry. PathReservations.reserve() unconditionally pushes entry.linkpath into its path list without any depth validation.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
tarnpm · osv:npm:tar
  • Every version before 8.0.0

Status in Debian

Debian builds fixes into its own packages, so a release is often fixed under an older version number than the one upstream names.

  • 4 vulnerable
PackageDebian releaseStatus
node-tarsidunstableVulnerableNo fix yet.
14forkytestingVulnerableNo fix yet.
13trixiestableVulnerableNo fix yet.
12bookwormoldstableVulnerableNo fix yet.

From Debian's security tracker for CVE-2026-140230 , read in the last 12 hours.

About tar

Weekly downloads (npm)
113,520,680npm, 1 Dec 2026

References