npm
CVE-2026-140237
node-tar: ReadEntry pending PAX size reapplication permits metadata-body file smuggling
- Severity
- Medium
- Published
- 2 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Fixed in
- 8.0.0
- Weakness
- CWE-436
- Also known as
- GHSA-p96f-8xj2-g85p
- Sources
- OSV.dev and GitHub
Description
A crafted tar archive containing consecutive PAX headers can make node-tar interpret a block inside a PAX metadata body as a real filesystem entry. Under default options, both tar.list() and tar.extract() expose the hidden entry, and extraction can truncate an existing file inside the destination directory.
The issue remains in [email protected] and current commit 2a22bfc5d3a432a606d9da0e2d87ba634aa3b1cb. It is a residual path around the PAX intermediary-entry fix released in 7.5.16.
The archive uses this sequence:
Header.decode() now checks the raw type flag and correctly refuses to apply pending PAX fields to the second PAX header. Its decoded size is therefore the physical value 512.
However, ReadEntry size initializes its body counters from that correct header, then ReadEntry.#slurp() copies the pending PAX object onto the entry without an entry-type guard.
The second PAX entry consequently has inconsistent state:
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-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-140239node-tar: Global PAX extended header injects attacker-controlled linkpath into tar.Parser entries, bypassing strict-mode validationHigh 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-140237
- GitHub Advisory Database https://github.com/advisories/GHSA-p96f-8xj2-g85p