chore(deps): update rust crate tar to v0.4.46 [security]#51
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update rust crate tar to v0.4.46 [security]#51renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
08c4817 to
c9e3d77
Compare
c3d7c9e to
43d0d4f
Compare
abe142c to
155ba47
Compare
1d3ab6c to
d49b1a3
Compare
1626474 to
49bcedf
Compare
49bcedf to
905c0ba
Compare
905c0ba to
97b2258
Compare
97b2258 to
6574aee
Compare
6574aee to
c61790b
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:
0.4.44→0.4.460.4.44→0.4.46tar-rs
unpack_incan chmod arbitrary directories by following symlinksCVE-2026-33056 / GHSA-j4xf-2g29-59ph
More information
Details
Summary
When unpacking a tar archive, the
tarcrate'sunpack_dirfunction usesfs::metadata()to check whether a path that already exists is a directory. Becausefs::metadata()follows symbolic links, a crafted tarball containing a symlink entry followed by a directory entry with the same name causes the crate to treat the symlink target as a valid existing directory — and subsequently applychmodto it. This allows an attacker to modify the permissions of arbitrary directories outside the extraction root.Reproducer
A malicious tarball contains two entries: (1) a symlink
foopointing to an arbitrary external directory, and (2) a directory entryfoo/.(or justfoo). When unpacked,create_dir("foo")fails withEEXISTbecause the symlink is already on disk. Thefs::metadata()check then follows the symlink, sees a directory at the target, and allows processing to continue. The directory entry's mode bits are then applied viachmod, which also follows the symlink — modifying the permissions of the external target directory.Fix
The fix is very simple, we now use
fs::symlink_metadata()inunpack_dir, so symlinks are detected and rejected rather than followed.Credit
This issue was reported by @xokdvium - thank you!
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
tar-rs incorrectly ignores PAX size headers if header size is nonzero
CVE-2026-33055 / GHSA-gchp-q4r4-x4ff
More information
Details
Summary
As part of CVE-2025-62518 the astral-tokio-tar project was changed to correctly honor PAX size headers in the case where it was different from the base header.
However, it was missed at the time that this project (the original Rust
tarcrate) had a conditional logic that skipped the PAX size header in the case that the base header size was nonzero - almost the inverse of the astral-tokio-tar issue.The problem here is that any discrepancy in how tar parsers honor file size can be used to create archives that appear differently when unpacked by different archivers.
In this case, the tar-rs (Rust
tar) crate is an outlier in checking for the header size - other tar parsers (including e.g. Goarchive/tar) unconditionally use the PAX size override.Details
https://github.com/astral-sh/tokio-tar/blob/aafc2926f2034d6b3ad108e52d4cfc73df5d47a4/src/archive.rs#L578-L600
https://github.com/alexcrichton/tar-rs/blob/88b1e3b0da65b0c5b9750d1a75516145488f4793/src/archive.rs#L339-L344
PoC
(originally posted by https://github.com/xokdvium)
It seems like recent fixes to https://edera.dev/stories/tarmageddon have introduced a differential that could be used to smuggle symlinks into the registry that would get skipped over by
astral-tokio-tarbut not bytar-rs.https://github.com/astral-sh/tokio-tar/blob/aafc2926f2034d6b3ad108e52d4cfc73df5d47a4/src/archive.rs#L578-L600
https://github.com/alexcrichton/tar-rs/blob/88b1e3b0da65b0c5b9750d1a75516145488f4793/src/archive.rs#L339-L344
tar-rsandastral-tokio-tarparse it differently, withastral-tokio-tarskipping over the symlink (so presumably the check from https://github.com/rust-lang/crates.io/blob/795a4f85dec436f2531329054a4cfddeb684f5c5/crates/crates_io_tarball/src/lib.rs#L92-L102 wouldn't disallow it).Impact
This can affect anything that uses the
tarcrate to parse archives and expects to have a consistent view with other parsers. In particular it is known to affect crates.io which usesastral-tokio-tarto parse, but cargo usestar.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
tar has a PAX header desynchronization issue
GHSA-3pv8-6f4r-ffg2
More information
Details
Summary
When a tar stream contains multiple "header" entries prior to a file entry, tar-rs applies the PAX header (
x) to the next entry in the stream, regardless of type. For example, a stream ofx -> L -> file(PAX, GNU longname, file) would result inx's extensions being applied toLrather than tofile.Per POSIX pax, this is incorrect: a PAX header always applies to a file entry, not any intermediary entries. See the "pax Header Block" section for the specific prescription there.
As a result of this, an attacker can contrive a tar containing a sequence of tar headers such that tar-rs applies the PAX header's
sizeextension to the next header in sequence, effectively desynchronizing the stream and enabling tar-rs specific skippage/extraction of members. In other words, a file can be contrived to extract differently on tar-rs than on other tar parsers.PoC
This tar (zipped for size) demonstrates the desynchronization: with
tar tvf:with
tar-rs:In the above case, the PoC is not weaponized, so it jumps into the middle of an entry and subsequently fails the checksum test rather than silently continuing with attacker-controlled archive state.
Impact
This is very similar to GHSA-j5gw-2vrg-8fgx and GHSA-fp55-jw48-c537 in impact -- an attacker can use this to extract (or not extract) files from a tar stream depending on the tar parser used, which in turn can be used to obscure the presence of malicious files.
Severity
Medium
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
composefs/tar-rs (tar)
v0.4.46Compare Source
Security
See also GHSA-3cv2-h65g-fgmm
Other changes
New Contributors
Full Changelog: composefs/tar-rs@0.4.45...0.4.46
v0.4.45Compare Source
Configuration
📅 Schedule: (in timezone America/Chicago)
🚦 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 these updates again.
This PR was generated by Mend Renovate. View the repository job log.