chore(deps): update rust crate tar to v0.4.45 [security]#7099
Merged
renovate[bot] merged 1 commit intodevelopfrom Mar 20, 2026
Merged
chore(deps): update rust crate tar to v0.4.45 [security]#7099renovate[bot] merged 1 commit intodevelopfrom
renovate[bot] merged 1 commit intodevelopfrom
Conversation
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.45GitHub Vulnerability Alerts
CVE-2026-33055
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.CVE-2026-33056
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!
Release Notes
alexcrichton/tar-rs (tar)
v0.4.45Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, 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.