Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseGHSA-8282-h5g3-523j

GHSA-8282-h5g3-523j: 
JavaScript vulnerability analysis and mitigation

Summary

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.

Root Cause

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).

Impact

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.

Proof of Concept

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)

Attack Chain

  1. Entry: crafted tar header name=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.
    • Guard: none at entry.
    • Bypass proof: no auth/config.
  2. Check: header.ts:154 decodeUtf8(buf,257,265) === 'ustar\u000000'.
    • Guard: strict magic+version equality.
    • Bypass proof: field is ustar\0\0\0 -> 'ustar\0' != 'ustar\u000000' -> condition false.
  3. Processing: prefix-join block (header.ts:173-181) never runs -> this.path stays file. Checksum still validates.
    • Guard: none.
    • Bypass proof: both oracles accept the same header and honor the prefix.
  4. Sink: entry emitted path=file, clean, no warning.
  5. Impact: a node-tar scanner records 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.

Bypass Evidence

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.

Affected Versions

<= 8.0.4 (latest release = HEAD b62c8bb). Code present on tag v8.0.4; no post-tag fix.

Suggested Fix

Treat a NUL/\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

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-7cfw-w2rf-f3jcMEDIUM5.3
  • JavaScript logoJavaScript
  • fast-xml-parser
NoYesDec 01, 2026
CVE-2026-141514LOW3.7
  • JavaScript logoJavaScript
  • minimatch
NoYesDec 01, 2026
GHSA-844h-fxvq-x544LOWN/A
  • JavaScript logoJavaScript
  • tar
NoYesDec 02, 2026
GHSA-8282-h5g3-523jLOWN/A
  • JavaScript logoJavaScript
  • tar
NoYesDec 02, 2026
GHSA-p4w4-63wp-74wqLOWN/A
  • JavaScript logoJavaScript
  • tar
NoYesDec 02, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management