HIGHCVSS v4 7.2Vulnerability

CVE-2026-140246

### Summary On a non-Windows host, extracting a crafted tar with default options makes node-tar (<= 7.5.22, current latest) create a SymbolicLink whose target resolves OUTSIDE the extraction directory, breaking the documented guarantee that "Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder". This allows arbitrary file read / extraction-containment escape (CWE-22 / CWE-59). Confirmed end-to-end on [email protected] with default tar.x() (async and sync), including reading /etc/passwd. It is distinct from, and survives, the drive-relative fixes (GHSA-9ppj-qmqm-q256 / CVE-2026-31802, GHSA-qffp-2rhf-9h96). ### Details Root cause is a separator-handling difference between the containment CHECK and the symlink CREATE. In Unpack[STRIPABSOLUTEPATH] (src/unpack.ts), the symlink linkpath is split for the ".." containment check AFTER stripped.replaceAll(/\\/g, '/') — i.e. "\" is treated as a path separator when counting segments. But on non-Windows, normalizeWindowsPath (src/normalize-windows-path.ts) is the identity function, and the symlink is created with the RAW linkpath: SYMLINK -> LINK calls fs.symlink(entry.linkpath, entry.absolute) (src/unpack.ts, ~lines 640-660 and 866-881), where "\" is an ordinary filename character. So a segment like "A\B" counts as TWO segments to the check but ONE to the kernel. Backslash padding inflates the check's segment count, so a ".." run that the check believes stays inside cwd actually escapes it at creation/resolution time. Walkthrough for entry.linkpath = "A\B/../../x": - CHECK ("\" -> "/"): ["A","B","..","..","x"] -> normalizes to "x" -> believed inside cwd -> ALLOWED - CREATE (Linux, "\" literal): ["A\B","..","..","x"] -> from cwd: cwd/A\B -> .. -> cwd -> .. -> parent of cwd -> ESCAPES The escape depth equals the number of backslashes in the padding segment (overshooting saturates at "/"), so any path on the same filesystem is reachable regardless of cwd depth. Why the other guards

Properties

Severity
high
Summary
node-tar: SymbolicLink extraction escapes the extraction directory on non-Windows hosts via a backslash separator differential
Nvd fetched at
2026-12-02T06:37:54.190518+00:00
Cvss severity
HIGH
Cvss score
7.2
Retrieved at
2026-12-02T06:39:20+00:00
Ghsa published
2026-12-02T01:09:07Z
Source url
https://github.com/advisories/GHSA-hqgx-p3r3-2cfg
Ghsa updated
2026-12-02T01:09:08Z
Ghsa id
GHSA-hqgx-p3r3-2cfg
Last source
GitHub Advisory Database
Score
7.2
Cvss version
4.0
Cve id
CVE-2026-140246
Cvss vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
First seen by Signal
2026-12-01T18:35:21+00:00
Name
CVE-2026-140246
Is ghsa only
false
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Published at
2026-12-01T18:17:28.937

Related Entities (4)

AFFECTS (1)

→[Software]npm/tar

VULNERABLE_TO (1)

←[Software]npm/tar

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-140246 (CVSS v4 7.2) — Ninja Signal Threat Intelligence | Ninja Signal