npm
CVE-2026-140234
node-tar: Incomplete NUL-byte truncation in ustar, GNU, and PAX names causes name differentials and async crashes
- Severity
- High
- Published
- 2 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Fixed in
- 8.0.0
- Weakness
- Null byte injection (CWE-158)
- Also known as
- GHSA-wpwg-r92p-fjjh
- Sources
- OSV.dev and GitHub
Description
Names are cut at the first NUL with .replace(/\0.*/, ''). Without the s flag, . doesn't match \n, \r, U+2028 or U+2029. If one of these follows the NUL, only part of the name is removed, and the NUL remains. The GHSA-gvwx-54wh-qm9j fix (7.5.17, commit 7a635c2) added this regex for PAX values on the assumption that PAX lines can't contain line terminators. The same regex is also used for ustar names and for GNU long-name/long-link data.
In async extraction, a name that still contains a NUL reaches fs and throws, which crashes a process that doesn't catch it (the outcome GHSA-gvwx-54wh-qm9j addressed). With strip, the surviving characters make node-tar's view of the name differ from other tools'.
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-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-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-140234
- GitHub Advisory Database https://github.com/advisories/GHSA-wpwg-r92p-fjjh