HIGHCVSS v4 7.2Vulnerability

CVE-2026-140235

### Summary node-tar parses POSIX pax extended headers by splitting the header body on every newline and validating each resulting line's length prefix, instead of consuming length-delimited records as the format specifies. A record whose value contains a newline (which occurs legitimately whenever an archived filename contains a newline) is mishandled two ways: the true record is dropped (the entry falls back to its truncated 100-byte header name), and any post-newline fragment that itself forms a self-valid `<length> key=value` line is applied as a real extended-header field. This is a cross-implementation divergence and an arbitrary PAX-field injection primitive (`path`, `size`, `linkpath`, `mode`, `uid`, `gid`, `mtime`) driven by a single attacker-controlled filename or crafted archive. ### Details ```ts // src/pax.ts:151-167 const parseKV = (str) => str.replace(/\n$/, '').split('\n') // <- splits INSIDE length-valid record values .reduce(parseKVLine, Object.create(null)) const parseKVLine = (set, line) => { const n = parseInt(line, 10) // XXX Values with \n in them will fail this. // Refactor to not be a naive line-by-line parse. if (n !== Buffer.byteLength(line) + 1) return set // record dropped when its value contained '\n' line = line.slice((n + ' ').length) // ... a forged '<len> key=value' fragment is then ACCEPTED as a real record } ``` POSIX pax records are `<len> key=value\n`, where `<len>` counts the entire record including any newline inside the value. Splitting on `\n` breaks a record whose value contains a newline into fragments: the leading fragment fails the `n === byteLength+1` check and is discarded, and a trailing fragment such as `24 path=forged-name.txt` passes the check and is applied. The maintainer's own in-code `XXX` comment documents the limitation. A related facet in the same parser: numeric fields are coerced with JavaScript `+v` (src/pax.ts:196, 205), so `size=0x10`, `size=1e3`, `size=1.5`, and `size=In

Properties

Summary
node-tar parses PAX extended headers by newline-splitting instead of length-delimiting, causing record dropping and forged-field injection
Severity
high
Nvd fetched at
2026-12-02T06:37:54.190518+00:00
Cvss score
7.2
Cvss severity
HIGH
Retrieved at
2026-12-02T06:39:20+00:00
Ghsa published
2026-12-02T01:38:49Z
Source url
https://github.com/advisories/GHSA-rgjp-p5j7-w36x
Ghsa updated
2026-12-02T01:38:50Z
Ghsa id
GHSA-rgjp-p5j7-w36x
Last source
GitHub Advisory Database
Score
7.2
Cvss version
4.0
Cve id
CVE-2026-140235
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-140235
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.007

Related Entities (4)

HAS_WEAKNESS (2)

AFFECTS (1)

→[Software]npm/tar

VULNERABLE_TO (1)

←[Software]npm/tar

Related research

Explore deeper with Ninja Signal's threat intelligence graph

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