Skip to content

[1.96] Fix CVE-2026-5222 and CVE-2026-5223#17030

Merged
weihanglo merged 2 commits into
rust-lang:rust-1.96.0from
emilyalbini:ea-cves
May 25, 2026
Merged

[1.96] Fix CVE-2026-5222 and CVE-2026-5223#17030
weihanglo merged 2 commits into
rust-lang:rust-1.96.0from
emilyalbini:ea-cves

Conversation

@emilyalbini

Copy link
Copy Markdown
Member

See the advisories for CVE-2026-5222 and CVE-2026-5223.

The first commit has been reviewed privately by @ehuss, @weihanglo and myself. The second commit has been reviewed privately by @arlosi.

arlosi and others added 2 commits May 25, 2026 10:47
Cargo has historically not allowed creating .crate packages containing
symlinks. (It packages the symlink target in place of the symlink,
instead.) So, any package containing a symlink would have to be
hand-constructed. Such packages are also not allowed on crates.io, so it
could only come from an alternate registry.

Rather than dealing with symlink traversal attacks when unpacking a
crate, just prohibit symlinks entirely.

In the process, also prohibit other kinds of unusual entries. As an
exception, allow character devices but warn about them, because some
exist in crates on crates.io.
@rustbot rustbot added A-git Area: anything dealing with git A-registries Area: registries S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 25, 2026
@rustbot

rustbot commented May 25, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

@rustbot

rustbot commented May 25, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against rust-1.96.0. Please double check that you specified the right target!

@weihanglo weihanglo enabled auto-merge May 25, 2026 09:03
@weihanglo weihanglo merged commit 30a34c6 into rust-lang:rust-1.96.0 May 25, 2026
45 of 58 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2026
@weihanglo

Copy link
Copy Markdown
Member

@emilyalbini would you have time doing a backport in rust-lang/rust?

@emilyalbini

Copy link
Copy Markdown
Member Author

@weihanglo it's going to be included in the stable PR by @cuviper

@emilyalbini emilyalbini deleted the ea-cves branch May 25, 2026 12:16
@cuviper

cuviper commented May 25, 2026

Copy link
Copy Markdown
Member

Can you also make a branch with these fixes for 1.97-beta? The submodule is currently at commit 4d1f984.

@ehuss

ehuss commented May 25, 2026

Copy link
Copy Markdown
Contributor

You are the one that normally creates the branch.

That is handled in https://forge.rust-lang.org/release/process.html#updating-the-base-of-the-beta-and-stable-branches.

@ehuss

ehuss commented May 25, 2026

Copy link
Copy Markdown
Contributor

Do you need the branch before that is run?

@cuviper

cuviper commented May 25, 2026

Copy link
Copy Markdown
Member

Yes, I updated the rust-lang/rust branches already. Here I mean a cargo branch (rust-1.97?) for these CVE fixes, from which I can update the submodule in rust beta.

@cuviper

cuviper commented May 25, 2026

Copy link
Copy Markdown
Member

Oh I see, that did create rust-1.97.0 here too -- so we just need another PR like this one.

@ehuss

ehuss commented May 25, 2026

Copy link
Copy Markdown
Contributor

Sure, posted #17032.

rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request May 25, 2026
[stable] prepare Rust 1.96.0

https://forge.rust-lang.org/release/process.html#stable-pr

- Update cargo for CVE-2026-5222 and CVE-2026-5223 (rust-lang/cargo#17030)
- Sync relnotes for 1.96.0
- Bump to stable release

r? cuviper
@rustbot rustbot added this to the 1.96.0 milestone May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-git Area: anything dealing with git A-registries Area: registries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants