npm
CVE-2026-140239
node-tar: Global PAX extended header injects attacker-controlled linkpath into tar.Parser entries, bypassing strict-mode validation
- Severity
- High
- Published
- 2 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Fixed in
- 8.0.0
- Also known as
- GHSA-ffhw-4r4q-5cwv
- Sources
- OSV.dev and GitHub
Description
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.
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:
In src/read-entry.js, the equivalent method has no such clause — it only excludes path:
The execution flow:
Affected software
| Software | Affected versions |
|---|---|
tarnpm · osv:npm:tar |
|
About tar
- Weekly downloads (npm)
- 113,520,680npm, 1 Dec 2026
Vulnerabilities in tar
- In our list
- 18
- Published in the last 12 months
- 18
- Critical, last 12 months
- 0
- High, last 12 months
- 17
- Known exploited
- 0
- CVE-2026-140234node-tar: Incomplete NUL-byte truncation in ustar, GNU, and PAX names causes name differentials and async crashesHigh 2 Dec 2026
- CVE-2026-140235node-tar parses PAX extended headers by newline-splitting instead of length-delimiting, causing record dropping and forged-field injectionHigh 2 Dec 2026
- CVE-2026-140236node-tar: Archive framing differential from PAX size still being applied to GNU/PAX meta entries via ReadEntry and related size/precedence inconsistenciesHigh 2 Dec 2026
- CVE-2026-140237node-tar: ReadEntry pending PAX size reapplication permits metadata-body file smugglingMedium 2 Dec 2026
- CVE-2026-140238node-tar: Newline injection in PAX extended-header records enables entry-attribute forgery (path overwrite → npm postinstall RCE on Windows)High 2 Dec 2026
- CVE-2026-140240node-tar: A small archive exhausts memory or CPU through path-reservation bookkeepingHigh 2 Dec 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-140239
- GitHub Advisory Database https://github.com/advisories/GHSA-ffhw-4r4q-5cwv