CVE-2026-140230 — Tar — CWE-400
### Summary 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. ### Details 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. getDirs() then materializes every parent-directory prefix of that path as individual JavaScript strings. For a linkpath with N segments this produces N strings of average length N/2, totaling O(N²) memory. A linkpath with 10000 segments causes instant catastrophic heap exhaustion. The GNU K (LongLink) extended-header mechanism allows a linkpath up to 1 MiB, roughly 524000 segments, which theoretically yields a ~275 GB memory allocation target. AFFECTED CODE src/path-reservations.ts — getDirs() function src/path-reservations.ts — reserve() function (no depth che
### Summary 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. ### Details 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. getDirs() then materializes every parent-directory prefix of that path as individual JavaScript strings. For a linkpath with N segments this produces N strings of average length N/2, totaling O(N²) memory. A linkpath with 10000 segments causes instant catastrophic heap exhaustion. The GNU K (LongLink) extended-header mechanism allows a linkpath up to 1 MiB, roughly 524000 segments, which theoretically yields a ~275 GB memory allocation target. AFFECTED CODE src/path-reservations.ts — getDirs() function src/path-reservations.ts — reserve() function (no depth che
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-140230
CVSS 7.1/10 · HIGH · 01.12.2026
CWE: CWE-400
Vector: 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
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Summary: ### Summary
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.
Affected: tar
⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · user interaction required (UI:R) · low attack complexity (AC:L).
🌍 REAL WORLD IMPACT
Partial confidentiality disclosure (C:L); service can be completely taken down.
🛡️ REMEDIATION
→ Apply vendor security update for tar.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
⚠️ This week (7 days) — High risk, anonymous remote.
────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]