CVE-2026-140239
## Summary A tar archive with a **Global Extended Header** (PAX type `g`) with a `linkpath` field injects that value into every entry returned by `tar.Parser` , including plain `File` and `Directory` entries, with **zero warnings under `strict: true`**. This happens because `header.js`'s `#slurp()` correctly excludes `linkpath` from global headers, but `read-entry.js`'s `#slurp()` does not apply the same filter. Any application that consumes `tar.Parser` or `tar.list()` directly and uses `entry.linkpath` to build paths or create symlinks, without revalidating the value, can be made to read or write files outside the intended directory via a crafted symlink. --- ## Details There are two separate `#slurp()` implementations apply Global Extended Header (`g`-type) fields to parsed state, and they filter different fields. In `src/header.js`, `#slurp(ex, gex = false)` **correctly** excludes `linkpath` when `gex` is `true`: ```js // header.js (correct) if (k === 'linkpath' && gex) continue; ``` In `src/read-entry.js`, the equivalent method has **no such clause** — it only excludes `path`: ```js // read-entry.js (bug: linkpath is not excluded) if (k === 'path' && gex) continue; // linkpath from the GEX is not filtered here ``` The execution flow: 1. `parse.js` calls `Pax.parse(meta, gex, true)` → stores the GEX object, including the `linkpath` field 2. `header.js` decode runs `#slurp(gex, true)` → correctly skips `linkpath` → `header.linkpath` is empty 3. `consumeHeader()` checks `header.linkpath` (empty) → the `"linkpath forbidden in global header"` warning **never fires** 4. `ReadEntry` constructor runs `this.#slurp(gex, true)` → no `linkpath` filter → **`entry.linkpath` is set to the attacker's value with no warning raised** Confirmed against `[email protected]`: - `node_modules/tar/dist/commonjs/read-entry.js` lines 122–132 (buggy `#slurp`) - `node_modules/tar/dist/commonjs/header.js` lines 184–194 (correct `#slurp`) **Scope note:** `tar`'s own extraction engine (
Properties
- Severity
- high
- Summary
- node-tar: Global PAX extended header injects attacker-controlled linkpath into tar.Parser entries, bypassing strict-mode validation
- 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:25:07Z
- Source url
- https://github.com/advisories/GHSA-ffhw-4r4q-5cwv
- Ghsa updated
- 2026-12-02T01:25:08Z
- Ghsa id
- GHSA-ffhw-4r4q-5cwv
- Last source
- GitHub Advisory Database
- Score
- 7.2
- Cvss version
- 4.0
- Cve id
- CVE-2026-140239
- 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-140239
- 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:27.827
Related Entities (4)
HAS_WEAKNESS (2)
AFFECTS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph