HIGHCVSS v4 7.2Vulnerability

CVE-2026-140247

## Summary With default options, `tar.x()` / `Unpack` / `UnpackSync` can be made to create `SymbolicLink` entries whose targets resolve outside the extraction directory, although the README states that "`Link` and `SymbolicLink` entries are not allowed to target locations outside of the extraction folder". The trick is a `..` segment that follows a symlink created earlier by the same archive: l1 SymbolicLink -> . esc SymbolicLink -> l1/../outside.txt (lexically "outside.txt", actually <cwd>/../outside.txt) escdir SymbolicLink -> l1/.. (lexically ".", actually the parent of cwd) or, to go further up (one level per in-archive directory): p/q/r/s SymbolicLink -> ../../.. (= cwd) x SymbolicLink -> p/q/r/s/../../../victim.txt (lexically "p/victim.txt", actually <cwd>/../../../victim.txt) None of these entries produces a warning, while the direct form (`esc -> ../outside.txt`) is still rejected. The step-2 symlink of the GHSA-83g3-92jg-28cx chain (`a/b/c/up -> ../..`, `a/b/escape -> c/up/../..`) also still points outside the extraction root on 7.5.23; that fix blocked only the step-3 hardlink. ## Affected versions Tested on [email protected] (latest; main HEAD eb92e17) with Node 18 on Linux, both async and sync extraction, default options. Versions containing the linkpath sanitization added for GHSA-8qq5 / GHSA-83g3 / GHSA-9ppj appear affected. ## Details - `src/unpack.ts` `[STRIPABSOLUTEPATH]` (~L283-301) accepts a symlink linkpath containing `..` when `path.posix.normalize(join(dirname(entry.path), linkpath))` does not start with `../`. This is purely lexical: `l1/../outside.txt` normalizes to `outside.txt`. - `[SYMLINK]` (~L640-660, same logic in `UnpackSync` ~L1099-1119) builds the components passed to `[ENSURE_NO_SYMLINK]` from `path.relative(cwd, path.resolve(dirname(abs), linkpath))`. `path.resolve` collapses `l1/..` before any `lstat`, so the existing symlink component `l1` i

Properties

Severity
high
Summary
node-tar: Symlink linkpath escape check is lexical: '..' after an in-archive symlink creates symlinks outside the extraction directory
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:01:59Z
Source url
https://github.com/advisories/GHSA-gvrf-jx37-rjv5
Ghsa updated
2026-12-02T01:02:00Z
Ghsa id
GHSA-gvrf-jx37-rjv5
Last source
GitHub Advisory Database
Score
7.2
Cvss version
4.0
Cve id
CVE-2026-140247
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-140247
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:29.093

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-140247 (CVSS v4 7.2) — Ninja Signal Threat Intelligence | Ninja Signal