CVE-2026-59871: node-tar: Process crash via PAX numeric path type confusion
Summary A crafted 2.5KB tar archive crashes any Node.js process that extracts it. The PAX header parser coerces all-digit path values to JavaScript numbers, which causes an uncaught TypeError when downstream code calls .split('/') on the numeric value. Error handlers and strict: false cannot intercept the crash. Details In pax.ts line 180, parseKV converts PAX values matching /^[0-9]+$/ to numbers via +v.
Published Jul 20, 2026
Affected packages
tar
- Ecosystem
- npm
- Affected
- <= 7.5.17
- Fixed in
- 7.5.18
- Check
npm ls tar
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
A crafted 2.5KB tar archive crashes any Node.js process that extracts it. The PAX header parser coerces all-digit path values to JavaScript numbers, which causes an uncaught TypeError when downstream code calls .split('/') on the numeric value. Error handlers and strict: false cannot intercept the crash.
Details
In pax.ts line 180, parseKV converts PAX values matching /^[0-9]+$/ to numbers via +v. This applies to all fields including path and linkpath. When a PAX header sets path to an all-digit string like "12345", the value becomes the number 12345.
This number flows through Header -> ReadEntry -> Unpack.CHECKPATH, where normalizeWindowsPath(entry.path).split('/') throws a TypeError because numbers don't have .split().
The throw is synchronous during event emission and bypasses all error handling:
strict: falsedoes not help'error'event handlers do not catch it'warn'handlers do not catch it- The TypeError propagates through the event emitter stack as an uncaughtException
Directory, SymbolicLink, and Link type entries reach CHECKPATH and crash. File type entries crash earlier in Header constructor at this.path.slice(-1), but that throw is caught and emitted as a warning only.
PoC
Create a tar archive with a PAX extended header containing an all-digit path:
PAX header body: "18 path=12345\n"
Entry type: Directory (type '5')Extract it:
const tar = require('tar');
// All of these crash with TypeError: t.split is not a function
tar.extract({ file: 'malicious.tar', cwd: '/tmp/test' });
// Error handlers don't help:
tar.extract({ file: 'malicious.tar', cwd: '/tmp/test', strict: false })
.on('error', (err) => { /* never reached */ })
.on('warn', (code, msg) => { /* never reached */ });The archive is ~2.5KB. The crash is deterministic on every attempt.
Impact
Denial of service. Any application or tool that extracts untrusted tar archives crashes from a single small file. This includes npm (which uses node-tar to extract packages), CI/CD pipelines, file upload processors, and backup tools. The crash cannot be caught by application-level error handling.
Credited to homanp.
References
- https://github.com/isaacs/node-tar/security/advisories/GHSA-w8wr-v893-vjvp
- https://nvd.nist.gov/vuln/detail/CVE-2026-59871
- https://github.com/isaacs/node-tar/commit/e02a4e9e013c4be95302e2eb2047a942b883c27b
- https://github.com/isaacs/node-tar/releases/tag/v7.5.18
- https://github.com/advisories/GHSA-w8wr-v893-vjvp
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-73566
node-tar: Uncontrolled recursion in mapHas/filesFilter allows uncatchable stack-overflow DoS via crafted long-path tar with member selection
high7.5Jul 24, 2026CVE-2026-59873
node-tar: Decompression/parse DoS via unlimited input
critical7.5Jul 20, 2026CVE-2026-59874
node-tar: Negative tar entry size causes infinite loop in archive replace
high7.5Jul 20, 2026CVE-2026-59875
node-tar: Uncaught Exception DoS via NUL byte in PAX path/linkpath records
medium5.3Jul 20, 2026CVE-2026-53655
node-tar applies PAX size override to intermediary GNU long-name/long-link headers, causing tar parser interpretation differential (file smuggling)
medium6.9Jun 15, 2026CVE-2026-31802
node-tar Symlink Path Traversal via Drive-Relative Linkpath
high8.2Mar 10, 2026
