All vulnerabilities

npm

CVE-2026-140250

node-tar: Symlink containment bypass via chained symlinks lets tar.x() create links that resolve outside the extraction directory (regression since 7.5.5)

Severity
High
Published
2 Dec 2026
Last changed
2 Dec 2026
Added to UpHeron
2 Dec 2026
Fixed in
8.0.0
Weakness
Path traversal (CWE-22)Link following (CWE-59)
Also known as
GHSA-3wwj-8j6r-q339
Sources
OSV.dev and GitHub

Description

With default options, tar.x() in [email protected] (and every release since 7.5.5) extracts a symbolic link that resolves outside the extraction directory when the link target passes through another symlink from the same archive and then uses .. — for example sub/up -> .. followed by esc -> sub/up/... Both symlink-target checks collapse .. lexically before considering symlinks, so the intermediate symlink is never seen, while the kernel resolves it before applying ... With enough nesting the extracted link resolves to /.

This breaks the README guarantee that "Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder", and gives any application that later reads or writes extracted paths file read/write outside the extraction root (the same impact model as GHSA-9ppj-qmqm-q256).

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

Affected software

SoftwareAffected versions
tarnpm · osv:npm:tar
  • From 7.5.5 before 8.0.0

About tar

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

References