Rust Crate 'rand' 0.9 Update Fixes Critical Soundness Vulnerability (GHSA-cq8v-f236-94qc)
A critical soundness vulnerability in the widely used Rust crate `rand` has been patched in version 0.9. The flaw, tracked as GHSA-cq8v-f236-94qc, is a library unsoundness issue, meaning safe Rust code using the public API could trigger undefined behavior under specific conditions. This type of vulnerability is particularly severe in Rust's safety-focused ecosystem, as it undermines the language's core guarantees.
The vulnerability manifests only when a specific constellation of features and code patterns align: the `log` and `thread_rng` features must be enabled, a custom logger must be implemented, and that logger must access `rand::rng()` (formerly `rand::thread_rng()`) and call `TryRng` methods on `ThreadRng`. The undefined behavior occurs if `ThreadRng` attempts to reseed itself while being called from within this logger context. The issue was reported by GitHub user @lopopolo.
The update from version 0.8 to 0.9 addresses this soundness hole. For developers and organizations relying on the `rand` crate, this is a mandatory security update. The presence of such a flaw in a fundamental library highlights the persistent risk of subtle concurrency and lifecycle bugs even in mature, widely-audited codebases, and underscores the necessity of proactive dependency management in software supply chains.