Symlink Attack Affecting tar package, versions >=7.5.22 <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
EPSS
0.92% (62nd percentile)

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-23314581
  • published2 Dec 2026
  • disclosed1 Dec 2026
  • creditmikkel32

Introduced: 1 Dec 2026

NewCVE-2026-140248  (opens in a new tab)
CWE-59  (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 Symlink Attack via a nested symlink chain during archive extraction in src/unpack.ts. A crafted archive first creates an in-root symlink (e.g. a/b -> ../x), then creates a second symlink whose linkpath traverses the first symlink followed by a parent component (e.g. a/c -> b/../..). The STRIPABSOLUTEPATH containment check evaluates the target lexically using path.posix.normalize, which collapses the b/.. pair before checking, while the OS filesystem follows the first symlink before applying the parent traversal. The resulting extracted link remains inside the extraction tree but resolves to a path outside it, allowing a later consumer that follows the planted link to access files outside the intended extraction root.

CVSS Base Scores

version 4.0
version 3.1