HIGHCVSS v4 7.2Vulnerability

CVE-2026-140245

### Summary A relative symlink linkpath is validated against path.posix.dirname(entry.path) but created at path.resolve(cwd, entry.path). An entry named 'x/.' shifts the check's base one level shallower, so one '..' is absorbed by the check and the link still escapes the extraction directory, with default options and no warning. Regression in 7.5.5-7.5.22 (introduced by the #450 fix). ### Details ### Mechanism `[STRIPABSOLUTEPATH]` resolves a relative `linkpath` against `path.posix.dirname(entry.path)` (`src/unpack.ts:286`), but the link is created at `path.resolve(cwd, entry.path)` (`src/unpack.ts:359`). For an entry name ending in `/.`, `dirname` returns a base one level shallower than the directory the link is actually created in. The check therefore normalises `x/../outside/secret.txt` to `outside/secret.txt`, which passes `startsWith('../')` at `:291`, while the kernel resolves the link from `cwd` and lands outside the destination. ### Affected `>= 7.5.5, <= 7.5.22`. The regression was introduced by `e9a1ddb` (the #450 relative-linkpath fix). `7.5.4` rejects the entry with `linkpath contains '..'`. ### Fix ```ts const base = path.posix.dirname(normalize(entry.path)) ``` Using the same base the filesystem will use makes the check and the write agree. Verified against a 1,464-pair property corpus: 300 buggy pairs rejected, 0 legitimate pairs rejected, 0 new accepts; 677 existing tests pass. ### Notes Distinct from GHSA-9ppj-qmqm-q256: that finding is a malicious *linkpath* string (`C:..`); here the linkpath is ordinary and the defect is the entry-path base computation. #450 introduced this code, so it is the regression rather than a duplicate. ### Proof of concept Reproduced against the npm-published `[email protected]` (not only a source checkout), with one archive entry and default options: ```js { path: 'x/.', type: 'SymbolicLink', linkpath: '../outside/secret.txt' } ``` ``` pad x -> ../outside/secret.txt realpath resolves outside dest warnings

Properties

Severity
high
Summary
node-tar: Symlink linkpath containment bypass via entry paths ending in '/.'
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:38Z
Source url
https://github.com/advisories/GHSA-jmj2-9c5q-vw73
Ghsa updated
2026-12-02T01:09:39Z
Ghsa id
GHSA-jmj2-9c5q-vw73
Last source
GitHub Advisory Database
Score
7.2
Cvss version
4.0
Cve id
CVE-2026-140245
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-140245
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.777

Related Entities (3)

AFFECTS (1)

→[Software]npm/tar

VULNERABLE_TO (1)

←[Software]npm/tar

Related research

Explore deeper with Ninja Signal's threat intelligence graph

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