Inefficient Algorithmic Complexity Affecting tar package, versions <8.0.0


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-TAR-23314611
  • published2 Dec 2026
  • disclosed1 Dec 2026
  • creditmanus-use

Introduced: 1 Dec 2026

NewCVE-2026-140118  (opens in a new tab)
CWE-407  (opens in a new tab)
CWE-770  (opens in a new tab)

How to fix?

Upgrade tar to version 8.0.0 or higher.

Overview

tar is a full-featured Tar for Node.js.

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via PathReservations.getDirs() in the asynchronous extraction path (tar.x, tar.extract, new Unpack()), where a deeply nested entry.linkpath delivered via a GNU 'K' long-linkpath meta entry causes O(n^2) CPU work and unbounded transient heap allocation. The existing maxDepth guard introduced by the CVE-2024-28863 fix applies only to entry.path, leaving entry.linkpath uncapped, so an attacker supplies an archive whose linkpath contains hundreds of thousands of single-character path components. The quadratic allocation exhausts the Node.js heap, freezes the event loop, and terminates the process with an uncatchable FATAL ERROR: heap out of memory (exit 134 / SIGABRT) that neither try/catch nor process.on('uncaughtException') can intercept.

Note: This is only exploitable on POSIX hosts; the reserve() path is a no-op on Windows.

CVSS Base Scores

version 4.0
version 3.1