
Cloud Vulnerability DB
A community-led vulnerabilities database
node-tar joins the 155-byte ustar prefix field onto the entry name only when the magic+version bytes exactly equal ustar\0 + ASCII 00. A version field of two NUL bytes (ustar\0\0\0) — which GNU tar 1.35 and Python tarfile both accept as valid ustar and for which they both honor the prefix — causes node-tar to skip the entire prefix-join block, so the path becomes just the short name and the attacker-controlled 155-byte prefix (which can carry directory components or ../ traversal) is silently dropped. All three parsers read the archive cleanly; node-tar is the lone outlier against BOTH references.
src/header.ts:154: if (decodeUtf8(buf, off + 257, off + 265) === 'ustar\u000000') gates the prefix-join block (header.ts:173-181) on an exact magic+version match. For version bytes \0\0 the string is 'ustar\0' which is not equal to the required 'ustar\u000000', so the prefix is never joined. The checksum still validates (version bytes are inside the checksummed region but sum to a valid value).
Interpretation differential (CWE-436): node-tar sees a short, benign path while GNU tar and Python tarfile both extract to an attacker-controlled directory (prefix join). Name/path smuggling hidden from whichever side of a pipeline runs node-tar. With prefix=../../../../etc, Python resolves ../../../../etc/passwd cleanly (GNU strips leading ../ with a warning). Victim parses an untrusted tar; no auth required.
name='file', prefix='evilprefix', magic bytes = 'ustar'\0 + version \0\0
node-tar : file warns=[] (prefix silently dropped)
GNU 1.35 : evilprefix/file clean, rc=0
Python : evilprefix/file clean
TRAVERSAL (prefix='../../../../etc', name='passwd', version=\0\0):
node-tar : passwd warns=[] (benign to a node-tar scanner)
Python : ../../../../etc/passwd clean (traversal honored)
GNU : ../../../../etc/passwd (strips leading ../ with a warning)file, prefix(off 345)=evilprefix (or ../../../../etc), magic+version(off 257)=75 73 74 61 72 00 00 00 (ustar + NUL + NUL-NUL version), valid checksum. Reachable unauthenticated by any consumer parsing an untrusted tar.header.ts:154 decodeUtf8(buf,257,265) === 'ustar\u000000'.ustar\0\0\0 -> 'ustar\0' != 'ustar\u000000' -> condition false.this.path stays file. Checksum still validates.file, clean, no warning.file; a GNU/Python extractor in the same pipeline writes evilprefix/file (or a traversing path). Bidirectional entry-name smuggling hidden from the node-tar side.On-disk reproduction vs GNU tar 1.35 and Python 3.14.7 tarfile, independently rebuilt during final review. Benign-prefix case: node-tar reads file, both oracles read evilprefix/file, all clean — node-tar is the lone outlier against BOTH references.
<= 8.0.4 (latest release = HEAD b62c8bb). Code present on tag v8.0.4; no post-tag fix.
\0\0 version field as valid ustar (as GNU and Python do) when deciding whether to apply the prefix field, or at minimum emit a warning when a non-empty prefix is present but discarded due to a non-00 version so the differential is not silent.Reported by zx (Jace) — GitHub: @manus-use
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."