Rollup merge of #159394 - renovate-bot:renovate/crate-tar-vulnerability, r=jieyouxu

Update Rust crate tar to v0.4.46 [SECURITY]

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [tar](https://redirect.github.com/composefs/tar-rs) | dependencies | patch | `0.4.45` → `0.4.46` |

---

### tar has a PAX header desynchronization issue
[GHSA-3pv8-6f4r-ffg2](https://redirect.github.com/advisories/GHSA-3pv8-6f4r-ffg2)

<details>
<summary>More information</summary>

#### 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 of `x -> L -> file` (PAX, GNU longname, file) would result in `x`'s extensions being applied to `L` rather than to `file`.

[Per POSIX pax](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/pax.html), 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 `size` extension 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](https://redirect.github.com/user-attachments/files/27141941/pax-overrides-extension-header.tar.zip) (zipped for size) demonstrates the desynchronization: with `tar tvf`:

```
% tar tvf tests/archives/pax-overrides-extension-header.tar
----------  0 0      0        2048 Dec 31  1969 longname.txt
----------  0 0      0           0 Dec 31  1969 file_b
```

with `tar-rs`:

```
---- pax_size_does_not_apply_to_extension_headers stdout ----

thread 'pax_size_does_not_apply_to_extension_headers' (250476889) panicked at tests/all.rs:2121:27:
called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "numeric field was not a number: AAAAAAAA when getting cksum for AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

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
- [https://github.com/composefs/tar-rs/security/advisories/GHSA-3pv8-6f4r-ffg2](https://redirect.github.com/composefs/tar-rs/security/advisories/GHSA-3pv8-6f4r-ffg2)
- [https://github.com/composefs/tar-rs/pull/454](https://redirect.github.com/composefs/tar-rs/pull/454)
- [bab14dd84b)
- [https://github.com/composefs/tar-rs/releases/tag/0.4.46](https://redirect.github.com/composefs/tar-rs/releases/tag/0.4.46)
- [https://github.com/advisories/GHSA-3pv8-6f4r-ffg2](https://redirect.github.com/advisories/GHSA-3pv8-6f4r-ffg2)

This data is provided by the [GitHub Advisory Database](https://redirect.github.com/advisories/GHSA-3pv8-6f4r-ffg2) ([CC-BY 4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Release Notes

<details>
<summary>composefs/tar-rs (tar)</summary>

### [`v0.4.46`](https://redirect.github.com/composefs/tar-rs/releases/tag/0.4.46)

[Compare Source](https://redirect.github.com/composefs/tar-rs/compare/0.4.45...0.4.46)

#### Security

- archive: Fix another PAX header desync (GHSA-3cv2-h65g-fgmm) by [@&#8203;cgwalters](https://redirect.github.com/cgwalters) in [#&#8203;454](https://redirect.github.com/composefs/tar-rs/pull/454)

See also <https://github.com/astral-sh/tokio-tar/security/advisories/GHSA-3cv2-h65g-fgmm>

#### Other changes

- ci: Fix and re-enable reverse dependency testing by [@&#8203;cgwalters](https://redirect.github.com/cgwalters) in [#&#8203;444](https://redirect.github.com/composefs/tar-rs/pull/444)
- Update astral-tokio-tar requirement from 0.5 to 0.6 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;446](https://redirect.github.com/composefs/tar-rs/pull/446)
- Update some links by [@&#8203;atouchet](https://redirect.github.com/atouchet) in [#&#8203;445](https://redirect.github.com/composefs/tar-rs/pull/445)
- Add support of absolute paths by [@&#8203;zxvfc](https://redirect.github.com/zxvfc) in [#&#8203;426](https://redirect.github.com/composefs/tar-rs/pull/426)
- docs: Expand notes on concurrent mutations and following symlinks by [@&#8203;cgwalters](https://redirect.github.com/cgwalters) in [#&#8203;453](https://redirect.github.com/composefs/tar-rs/pull/453)
- Update repo links by [@&#8203;cgwalters](https://redirect.github.com/cgwalters) in [#&#8203;451](https://redirect.github.com/composefs/tar-rs/pull/451)
- ci: Add crates.io trusted publishing workflow by [@&#8203;cgwalters](https://redirect.github.com/cgwalters) in [#&#8203;456](https://redirect.github.com/composefs/tar-rs/pull/456)
- Release 0.4.46 by [@&#8203;cgwalters](https://redirect.github.com/cgwalters) in [#&#8203;455](https://redirect.github.com/composefs/tar-rs/pull/455)

#### New Contributors

- [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] made their first contribution in [#&#8203;446](https://redirect.github.com/composefs/tar-rs/pull/446)
- [@&#8203;atouchet](https://redirect.github.com/atouchet) made their first contribution in [#&#8203;445](https://redirect.github.com/composefs/tar-rs/pull/445)
- [@&#8203;zxvfc](https://redirect.github.com/zxvfc) made their first contribution in [#&#8203;426](https://redirect.github.com/composefs/tar-rs/pull/426)

**Full Changelog**: <https://github.com/composefs/tar-rs/compare/0.4.45...0.4.46>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rust-lang/rust).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjUuMSIsInVwZGF0ZWRJblZlciI6IjQzLjI2NS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
This commit is contained in:
Jonathan Brouwer
2026-07-16 21:01:51 +02:00
committed by GitHub
2 changed files with 13 additions and 13 deletions

View File

@@ -871,7 +871,7 @@ version = "3.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34"
dependencies = [
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -1284,7 +1284,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -1411,7 +1411,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -2198,7 +2198,7 @@ dependencies = [
"portable-atomic",
"portable-atomic-util",
"serde_core",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -2685,7 +2685,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -5113,7 +5113,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -5526,9 +5526,9 @@ dependencies = [
[[package]]
name = "tar"
version = "0.4.45"
version = "0.4.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973"
checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840"
dependencies = [
"filetime",
"libc",
@@ -5545,7 +5545,7 @@ dependencies = [
"getrandom 0.3.3",
"once_cell",
"rustix",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -5564,7 +5564,7 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8c27177b12a6399ffc08b98f76f7c9a1f4fe9fc967c784c5a071fa8d93cf7e1"
dependencies = [
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -6542,7 +6542,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]

View File

@@ -757,9 +757,9 @@ dependencies = [
[[package]]
name = "tar"
version = "0.4.45"
version = "0.4.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973"
checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840"
dependencies = [
"filetime",
"libc",