Update Rust crate rand [SECURITY] - #160783
Conversation
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? @marcoieni, can we get it to either stop or figure out a better process for this? There's nothing actually wrong with our usage of rand so this is essentially just noise. |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This PR contains the following updates:
0.9.3→0.9.40.9.0→0.10.0Rand is unsound with a custom logger using rand::rng()
GHSA-cq8v-f236-94qc
More information
Details
It has been reported (by @​lopopolo) that the
randlibrary is unsound (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:logandthread_rngfeatures are enabledrand::rng()(previouslyrand::thread_rng()) and calls anyTryRng(previouslyRngCore) methods onThreadRngThreadRng(attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)getrandomcrate) is unable to provide a new seedTryRng(previouslyRngCore) methods forThreadRnguseunsafecode to cast*mut BlockRng<ReseedingCore>to&mut BlockRng<ReseedingCore>. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of aliased mutable references is Undefined Behaviour, the behaviour of optimized builds is hard to predict.Severity
Low
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
rust-random/rand (rand)
v0.9.4Compare Source
Fixes
Full Changelog: rust-random/rand@0.9.3...0.9.4
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.