chore(deps): update dependency tar to v7.5.16 [security]#1205
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update dependency tar to v7.5.16 [security]#1205renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
Branch automerge failureThis PR was configured for branch automerge. However, this is not possible, so it has been raised as a PR instead. |
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.15→7.5.16node-tar applies PAX size override to intermediary GNU long-name/long-link headers, causing tar parser interpretation differential (file smuggling)
CVE-2026-53655 / GHSA-vmf3-w455-68vh
More information
Details
Summary
tar(node-tar) applies a PAX extended header'ssize=record (and other PAXoverrides) to the next header entry of any type, including intermediary
metadata headers such as a GNU long-name (
L) or long-link (K) entry. PerPOSIX pax, a PAX extended header (
x) describes the next file entry, not theintermediary extension headers that may sit between the
xheader and the fileit annotates. Because node-tar lets the PAX
sizeoverride the byte length ofan intervening
L/K/xheader, an attacker can desynchronize node-tar'sstream cursor relative to every other mainstream tar implementation
(GNU tar, libarchive/bsdtar, Python
tarfile, and the now-fixedtar-rs/astral-tokio-tar).The result is a tar parser interpretation differential (CWE-436): a single
crafted archive yields a different set of members under node-tar than under the
reference tar tools. An attacker can use this to hide a member from one parser
while it is visible to another, which defeats security tooling whose scanner and
extractor disagree on archive contents (e.g. a malware/secret scanner that lists
entries with one library while a downstream step extracts with another). node-tar
is one of the most widely deployed JavaScript tar libraries (it backs
npm's ownpackage-tarball handling and is a transitive dependency of a very large fraction
of the npm ecosystem), so the blast radius for "files that extract differently
depending on the tool" is broad.
This is the same root cause and fix that was just addressed upstream in the Rust
tar ecosystem (
tar-rs/astral-tokio-tar); node-tar carries the equivalentdefect and has no equivalent guard.
Impact
the prior tar "smuggling" advisories GHSA-j5gw-2vrg-8fgx and
GHSA-fp55-jw48-c537).
scans with node-tar and a different member list to GNU tar / libarchive /
Python tarfile (and vice versa). This lets a malicious file be hidden from a
scanner that uses a different parser than the eventual extractor, or hidden
from node-tar-based inspection while still landing on disk via a system
tar.an attacker-supplied tar with node-tar. Tar archives are routinely fetched
from untrusted sources (package registries, user uploads, CI artifacts,
container layers).
RCE; it is a building block for supply-chain / scanner-evasion attacks rather
than a standalone code-execution primitive.
Vulnerable code (file:line)
src/header.ts(compiled todist/esm/header.js:49anddist/commonjs/header.js:85in the publishedtar@7.5.15):exis the currently-accumulated PAX local extended header andgexthePAX global header. The
sizeoverride fromex/gexis appliedunconditionally to whatever header is being decoded next — there is no check
that the header being decoded is a real file entry rather than an intermediary
extension header.
src/parse.ts,[CONSUMEHEADER]constructs the next header with the currentEX/GEXapplied:and later branches on whether that header is a metadata entry.
this[EX]iscleared only in the non-meta (real file) branch:
When the stream is ordered
x (PAX, size=N) -> L (GNU long-name) -> file, theLheader is constructed withthis[EX]still set, so itssize/remainbecomes
Ninstead of theLpayload's true length. node-tar then consumesNbytes of "metadata" and resumes header parsing at the wrong offset, landing
mid-stream. Every other mainstream parser applies the PAX
sizeonly to thefollowing file entry, so they stay synchronized.
The correct behavior (and the fix shipped upstream in the Rust tar ecosystem) is
to not apply PAX
size/overrides when the entry being decoded is itself anextension header (
LGNU long-name,KGNU long-link,xPAX local,gPAXglobal).
How input reaches the sink
tar.list(),tar.extract()/tar.x(), andtar.Parse/tar.Unpackall routeevery 512-byte header block through
Header.decode(...)with thecurrently-accumulated
EX/GEX. Any consumer that parses an attacker-suppliedarchive —
tar.list,tar.extract, or piping into the streamingParser—reaches the sink. No options need to be enabled; the default code path is
affected.
Proof of concept
Archive layout (all standard, GNU-tar-producible blocks):
Generator (
make_tar.py, pure stdlib, no external deps):A negative-control archive is identical except the PAX record is
pax_record('comment', 'x')(nosize=), written topax-control.tar.End-to-end reproduction (against pinned version
tar@7.5.15, latest release)Install the published package into a clean project and parse both archives:
e2e.mjs:Verbatim output:
Reference parsers on the same
pax-desync.tar:Interpretation differential: GNU tar, libarchive (bsdtar), and Python
tarfileall extract the member
longname.txtfrompax-desync.tar, whereas node-tar7.5.15desynchronizes, raisesTAR_ENTRY_INVALID(checksum failure fromlanding mid-stream), and reports zero members. The negative control proves
the divergence is caused solely by the PAX
size=override being applied to theintermediary
Lheader — when the same archive carries a PAX record withoutsize=, node-tar parses it identically to the reference tools(
longname.txt,file_b).Suggested fix
When decoding a header, do not apply PAX
size(or other PAX overrides) if theheader being decoded is itself an extension header. Concretely, in
src/parse.tsclear/ignorethis[EX](andthis[GEX]forsize) when theheader's type is
ExtendedHeader,GlobalExtendedHeader,NextFileHasLongPath(GNU
L), orNextFileHasLongLinkpath(GNUK); equivalently, inHeader.decode, gate theex?.size ?? gex?.sizeoverride on the decoded typenot being one of those extension types. This mirrors the upstream Rust fix,
which guards
pax_sizewithis_gnu_longname || is_gnu_longlink || is_pax_local_extensions || is_pax_global_extensions.A fix PR is being prepared against a private fork and will be linked here.
Fix PR
To be linked from a private fork of the repository (the fix will not be pushed
to any public fork or to upstream during embargo).
Credits
Reported by tonghuaroot.
Severity
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
isaacs/node-tar (tar)
v7.5.16Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ 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.