Insufficient Verification of Data Authenticity 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-23314614
  • published2 Dec 2026
  • disclosed2 Dec 2026
  • creditArjun Jain

Introduced: 2 Dec 2026

NewCVE-2026-140239  (opens in a new tab)
CWE-1284  (opens in a new tab)
CWE-345  (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 Insufficient Verification of Data Authenticity via the #slurp() method in read-entry.js, which fails to filter the linkpath field when applying Global PAX Extended Header (g-type) fields to parsed entries. header.js correctly excludes linkpath from global headers with a guard clause, but read-entry.js contains no equivalent filter, so an attacker-controlled linkpath value from a Global Extended Header is injected into every subsequent tar.Parser entry - including plain File and Directory entries - with no warning raised even under strict: true. Any application that consumes tar.Parser or tar.list() directly and uses entry.linkpath to build filesystem paths or create symlinks without revalidating the value can be made to read or write files outside the intended directory via a path-traversal symlink.

Note: This is only exploitable in applications that use tar.Parser or tar.list() directly and act on entry.linkpath without bounds-checking; applications that use only tar.x() / tar.extract() are not affected because the Unpack layer's STRIPABSOLUTEPATH guard rejects an escaping linkpath at extraction time.

CVSS Base Scores

version 4.0
version 3.1