chore(deps): update dependency tar to v7.5.19 [security]#450
Draft
renovate[bot] wants to merge 1 commit into
Draft
chore(deps): update dependency tar to v7.5.19 [security]#450renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
📝 WalkthroughWalkthroughThe package configuration updates the Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #450 +/- ##
===========================
===========================
🚀 New features to boost your workflow:
|
renovate
Bot
force-pushed
the
renovate/npm-tar-vulnerability
branch
from
July 21, 2026 10:33
9df55b0 to
88bbbcd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
7.5.16→7.5.19node-tar: Uncaught Exception DoS via NUL byte in PAX path/linkpath records
CVE-2026-59875 / GHSA-gvwx-54wh-qm9j
More information
Details
Summary
node-tarstrips trailingNULbytes from long-name (L) and long-linkpath (K) GNU extended headers but does not apply the same sanitization to equivalent fields delivered via PAX (xtypeflag) extended headers. A PAX record of the formpath=visible.txt\x00hidden.txtis parsed verbatim intoentry.pathand flows intofs.lstat()/fs.open(), which Node.js core rejects withERR_INVALID_ARG_VALUE. The throw originates inside anFSReqCallbackasync chain that is not wrapped by the consumer'sawait/try-catcharoundtar.x()— it surfaces asuncaughtExceptionand terminates the process.This is a remote denial-of-service primitive against any process that extracts attacker-supplied tarballs through
tar.x/tar.extract/tar.t/tar.Parser, even when the consumer follows the documentedtry/catcherror-handling pattern.A secondary parser-differential (CWE-436) exists because
tar(1),bsdtar, and Pythontarfiletruncate the path at the firstNUL(yieldingvisible.txt) while node-tar retains the full string. A validator that pre-scans a tarball with one tool and extracts with the other is bypassed.Root cause
Vulnerable sink —
src/pax.ts:157-183PAX KV records flow through
parseKVLine. The value half (v) is assigned directly to the result object with no sanitization for embedded NUL bytes:The PAX record body is length-prefixed, so the parser knows the exact byte boundary — but it never checks whether the value half between
=and\ncontainsNUL. The result is consumed byHeader/ReadEntry, whereentry.pathandentry.linkpathcarry the embedded NUL all the way tofs.lstat().Correctly-patched cousin sink —
src/parse.ts:375-388The equivalent code path for GNU L/K long-headers does strip NUL bytes:
The
parse.tsfix is the maintainer's own acknowledgement that path strings on this codepath must be NUL-stripped before reachingfs.*. The PAX path produces the identical primitive but bypasses the guard.Downstream blast radius
entry.pathandentry.linkpathare consumed in:src/unpack.ts→fs.lstat,fs.open,fs.symlink,fs.link,fs.mkdirsrc/list.ts(no crash — listing tolerates NUL in strings)ReadEntryevent that callspath.join()/fs.*onentry.pathThe crash fires inside the FSReqCallback Node-internal async machinery, outside the user's
await tar.x(...)Promise rejection boundary.Proof of Concept
Artifacts
poc-null-byte-crash.tar— 3072 bytes — PAXpath=visible.txt\x00hidden.txtpoc-null-linkpath-crash.tar— 2560 bytes — PAXlinkpath=target\x00garbage(symlink target sink)poc1-pax-prefix.py— minimal PAX-header builder (Python 3, no deps)Tarball generator (minimal repro — Python 3)
Reproduction
Observed output (verified 2026-06-23 against
tar@7.5.16)The exception bypasses the user's
try { await tar.x(...) } catch (e) { ... }block and lands in the globaluncaughtExceptionhandler. In a typical server without that handler, the process exits.Impact
Direct: remote DoS
Any service that ingests attacker-supplied tarballs via node-tar inherits a one-tarball-kills-the-process primitive. Realistic deployments where this is reachable without user interaction:
actions/cache,actions/setup-*extracting toolchains)A correctly-coded consumer that does:
does not catch this throw. The Node process dies and (depending on the supervisor) the worker may take time to respawn or never respawn if it dies during boot.
Secondary: parser-differential validator bypass (CWE-436)
path=visible.txt\x00hidden.txttar -tvf)visible.txt(truncated at NUL)bsdtar -tvfvisible.txt(truncated at NUL)tarfile.list()visible.txt\x00hidden.txt(raw)tar.t({file})tar.x({file})A pre-flight validator using GNU tar or bsdtar will see a benign filename; the subsequent node-tar extraction blows up. This is exploitable against any architecture that lists-and-validates-then-extracts.
Suggested patch
Match the long-name handler in
parse.ts— strip everything from the first NUL onward inparseKVLinevalue parsing:This matches
src/parse.ts:379andsrc/parse.ts:386and closes bothpathandlinkpathsinks in one change.A defense-in-depth follow-up: add an explicit
assert(!v.includes('\0'))(or fail-softreturn set) at the top ofparseKVLineso malformed PAX records that aren't path/linkpath also can't smuggle NUL into other unanticipated consumers (e.g. third-party readers ofentry.header.atimeDate objects constructed fromNumber(v)wherevhad embedded NUL).Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
node-tar: Negative tar entry size causes infinite loop in archive replace
CVE-2026-59874 / GHSA-8x88-c5mf-7j5w
More information
Details
Summary
A checksum-valid tar archive with a negative base-256 encoded entry size can make
tar.replace()loop forever while scanning the existing archive. Applications that update attacker-controlled tar archives can have a worker process pinned indefinitely, causing denial of service.Details
The public
tar.replace()API scans the existing archive before appending replacement entries. During this scan, it parses each tar header and advances the archive position by the parsed entry size rounded to a 512-byte block boundary.Tar supports base-256 encoded numeric fields. A crafted header can encode the entry size as
-512while still carrying a valid checksum. The replace scan accepts that parsed negative size and uses it in the position-advance calculation.For a size of
-512, the computed body skip is-512. The scan then adds the normal 512-byte header step, resulting in no net progress. The scanner repeatedly parses the same header forever and never reaches the append step.This is reachable through the supported package API when the existing archive file is attacker controlled. It does not rely on extraction, dependency behavior, or an uncaught exception.
PoC
Save as
poc.mjsin a project with the vulnerable package installed and run:Impact
An application that calls
tar.replace()on an existing archive supplied or controlled by an attacker can be forced into a non-terminating archive scan. This can consume a worker process indefinitely and cause denial of service. Plain extraction-only workflows are not affected by this finding.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
node-tar: Decompression/parse DoS via unlimited input
CVE-2026-59873 / GHSA-23hp-3jrh-7fpw
More information
Details
Summary
A Decompression/parse DoS via unlimited input vulnerability in
node-tarallows an attacker to exhaust server resources (disk space and CPU). Because the library does not enforce hard upper bounds on total decompressed data or entry counts, a small, maliciously crafted "Gzip Bomb" can be used to fill a server's storage and crash services.Details
The
node-tarlibrary does not enforce a hard upper bound on archive size or the volume of decompressed data processed during extraction. While themaxReadSizeoption exists, it only controls internal read chunk sizes (default 16MB) and does not limit the total cumulative bytes written to disk.Specifically, in
src/extract.ts, theUnpackstream processes entries as they arrive. There is no total-bytes limit, entry-count limit, or decompression ratio guard. An attacker can provide a TAR header claiming a massive file size (e.g., 10GB) and follow it with highly compressible data (like zeros).node-tarwill continue to extract and write this data until the physical disk is exhausted, as it lacks a mechanism to abort based on global resource consumption.PoC
The following Proof of Concept demonstrates how a tiny compressed input can be expanded into gigabytes of data on the host machine almost instantly.
Observation: You will see the extracted size rapidly climb to 5,000 MB+ within seconds, while the actual data being "sent" through the gzip stream is negligible.
Impact
This is a Denial of Service (DoS) vulnerability. It impacts any application or service that uses
node-tarto extract archives provided by untrusted users (e.g., npm registries, CI/CD pipelines, or file-sharing platforms). An unauthenticated attacker can send a small payload that expands to consume all available disk space, leading to system-wide failure and service outages.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
node-tar: Process crash via PAX numeric path type confusion
CVE-2026-59871 / GHSA-w8wr-v893-vjvp
More information
Details
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 andstrict: falsecannot intercept the crash.Details
In
pax.tsline 180,parseKVconverts PAX values matching/^[0-9]+$/to numbers via+v. This applies to all fields includingpathandlinkpath. When a PAX header setspathto an all-digit string like"12345", the value becomes the number12345.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 itDirectory, 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:
Extract it:
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.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
isaacs/node-tar (tar)
v7.5.19Compare Source
v7.5.18Compare Source
v7.5.17Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.