fix(security): Update Rust crate rand to 0.9.3 [SECURITY] #27
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
in-progress
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
vxfemboy/purrcrypt!27
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/crate-rand-vulnerability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.9.0→0.9.3Rand is unsound with a custom logger using rand::rng()
GHSA-cq8v-f236-94qc / RUSTSEC-2026-0097
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 OSV and the GitHub Advisory Database (CC-BY 4.0).
Rand is unsound with a custom logger using
rand::rng()GHSA-cq8v-f236-94qc / RUSTSEC-2026-0097
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
Unknown
References
This data is provided by OSV and the Rust Advisory Database (CC0 1.0).
Release Notes
rust-random/rand (rand)
v0.9.3Compare Source
This release back-ports a fix from v0.10. See also [#1763].
Changes
log(#1764)doc_auto_cfg(#1764)Full Changelog: https://github.com/rust-random/rand/compare/0.9.2...0.9.3
v0.9.2Compare Source
Deprecated
rand::rngs::mockmodule andStepRnggenerator ([#1634])Additions
WeightedIndex<usize>(de)serialization ([#1646])v0.9.1Compare Source
Security and unsafe
zerocopydependency fromrand(#1579)Fixes
simd_supportfor recent nightly rust (#1586)Changes
fn rand::seq::index::sample_weightedandfn IndexedRandom::choose_multiple_weightedto return fewer thanamountresults (#1623), reverting an undocumented change ([#1382]) to the previous release.Additions
rand::distr::Alphabeticdistribution. (#1587)rand_core(#1604)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.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
4c88503a63to52624d4664Edited/Blocked Notification
Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.
You can manually request rebase by checking the rebase/retry box above.
⚠️ Warning: custom changes will be lost.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.