Skip to content
NOUMENResearch
Network
Engineering
, home page

IntelligenceFindingsNMN-2026-0176

Rand is unsound with a custom logger using `rand::rng()`

CandidateMachine- or researcher-generated; not independently verified.

In short

What to know.

Package
rand crates.iorand: from 0.10.0 before 0.10.1
What to do
Upgrade rand to 0.8.6 or 0.9.3 or 0.10.1 or later.
Severity
UnknownRated by the source advisory.
Confidence
HighThe affected range comes from the advisory; no system that uses the component has been assessed.

Verification

Where it stands.

  1. Candidate
  2. In review
  3. Reproduced
  4. Confirmed
  5. Resolved
  6. Disputed
  7. Withdrawn
Candidate Machine- or researcher-generated; not independently verified.

What each state means, and how a record moves between them.

6 listed

Sources

  1. OSV record RUSTSEC-2026-0097osv.devRetrieved 3 December 2026
  2. package reference for RUSTSEC-2026-0097crates.ioRetrieved 3 December 2026
  3. advisory reference for RUSTSEC-2026-0097rustsec.orgRetrieved 3 December 2026
  4. web reference for RUSTSEC-2026-0097github.comRetrieved 3 December 2026
  5. OSV record GHSA-cq8v-f236-94qcosv.devRetrieved 3 December 2026
  6. package reference for GHSA-cq8v-f236-94qcgithub.comRetrieved 3 December 2026

Full record

Finding
NMN-2026-0176
Category
vulnerability
Component
rand (crates.io)rand: from 0.10.0 before 0.10.1
Severity
Unknown. Rated by the source advisory.The source advisory RUSTSEC-2026-0097 gives no severity label. Noumen has not assessed it.
Confidence
High.The affected range comes from the advisory; no system that uses the component has been assessed.
State
Candidate. Machine- or researcher-generated; not independently verified.
Disclosure
Public
Mitigation
Upgrade rand to 0.8.6 or 0.9.3 or 0.10.1 or later.
Discovery method
imported from a public advisory by the Advisory Monitor (1.0.0)Machine-generated by the agent advisory-monitor@1.0.0.
Reproduction
No reproduction steps recorded.
Affected systems
None listed. A link to a system needs its own evidence.
Attribution
Researcher: advisory-monitor@1.0.0 (agent, machine-generated)Validators: None yet
Assigned reviewer
Nobody yet
Dates
Created 3 December 2026, 16:52 UTCUpdated 3 December 2026, 16:52 UTC
Summary, as published by the source advisory
As published by the source advisory
It has been reported (by [@lopopolo](https://github.com/lopopolo)) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met: - The `log` and `thread_rng` features are enabled - A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined - The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng` - The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data) - Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed `TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsafe` code 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](https://doc.rust-lang.org/stable/nomicon/references.html), the behaviour of optimized builds is hard to predict.

2 events, oldest first

History

History verified: 2 eventsLatest hash9d985bb11f0c9d985bb11f0c4218149373d1913a6810d1b9b1e24743134cba45c2d71509407b

  1. Record createdMachine-generated

    By advisory-monitor@1.0.0 (agent, machine-generated)

    Reason: Imported from public advisory GHSA-cq8v-f236-94qc.

    Entered the record in the state Candidate.

    Event 1 hash318635aaa784318635aaa7840d8474f015ffa156ab37c08d8de6b5072fe8954425b5d0a5f3c5
  2. CorrectionMachine-generated

    By advisory-monitor@1.0.0 (agent, machine-generated)

    Reason: The source advisory RUSTSEC-2026-0097 changed.

    Title

    Before

    Rand is unsound with a custom logger using rand::rng()

    After

    Rand is unsound with a custom logger using `rand::rng()`

    Sources

    Before

    [ { "url": "https://osv.dev/vulnerability/GHSA-cq8v-f236-94qc", "title": "OSV record GHSA-cq8v-f236-94qc", "retrieved": "2026-12-03" }, { "url": "https://github.com/rust-random/rand/pull/1763", "title": "web reference for GHSA-cq8v-f236-94qc", "retrieved": "2026-12-03" }, { "url": "https://github.com/rust-random/rand", "title": "package reference for GHSA-cq8v-f236-94qc", "retrieved": "2026-12-03" }, { "url": "https://rustsec.org/advisories/RUSTSEC-2026-0097.html", "title": "web reference for GHSA-cq8v-f236-94qc", "retrieved": "2026-12-03" } ]

    After

    [ { "url": "https://osv.dev/vulnerability/RUSTSEC-2026-0097", "title": "OSV record RUSTSEC-2026-0097", "retrieved": "2026-12-03" }, { "url": "https://crates.io/crates/rand", "title": "package reference for RUSTSEC-2026-0097", "retrieved": "2026-12-03" }, { "url": "https://rustsec.org/advisories/RUSTSEC-2026-0097.html", "title": "advisory reference for RUSTSEC-2026-0097", "retrieved": "2026-12-03" }, { "url": "https://github.com/rust-random/rand/pull/1763", "title": "web reference for RUSTSEC-2026-0097", "retrieved": "2026-12-03" }, { "url": "https://osv.dev/vulnerability/GHSA-cq8v-f236-94qc", "title": "OSV record GHSA-cq8v-f236-94qc", "retrieved": "2026-12-03" }, { "url": "https://github.com/rust-random/rand", "title": "package reference for GHSA-cq8v-f236-94qc", "retrieved": "2026-12-03" } ]

    Summary

    Before

    It has been reported (by @lopopolo) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met: - The `log` and `thread_rng` features are enabled - A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined - The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng` - The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data) - Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed `TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsa... (444 more characters)

    After

    It has been reported (by [@lopopolo](https://github.com/lopopolo)) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met: - The `log` and `thread_rng` features are enabled - A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined - The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng` - The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data) - Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed `TryRng` (previously `RngCore`) me... (475 more characters)

    Affected versions

    Before

    [ { "name": "rand", "ranges": [ { "fixed": "0.9.3", "introduced": "0.9.0" } ], "ecosystem": "crates.io" }, { "name": "rand", "ranges": [ { "fixed": "0.10.1", "introduced": "0.10.0" } ], "versions": [ "0.10.0" ], "ecosystem": "crates.io" }, { "name": "rand", "ranges": [ { "fixed": "0.8.6", "introduced": "0.7.0" } ], "ecosystem": "crates.io" } ]

    After

    [ { "name": "rand", "ranges": [ { "fixed": "0.10.1", "introduced": "0.10.0" } ], "ecosystem": "crates.io" } ]

    Severity

    Before

    low

    After

    unknown

    Mitigation

    Before

    Upgrade rand to 0.9.3 or later. Upgrade rand to 0.10.1 or later. Upgrade rand to 0.8.6 or later.

    After

    Upgrade rand to 0.8.6 or 0.9.3 or 0.10.1 or later.

    severityRationale

    Before

    Severity as labelled by the source advisory GHSA-cq8v-f236-94qc. Noumen has not assessed it.

    After

    The source advisory RUSTSEC-2026-0097 gives no severity label. Noumen has not assessed it.

    Event 2 hash9d985bb11f0c9d985bb11f0c4218149373d1913a6810d1b9b1e24743134cba45c2d71509407b
About this record

Severity and confidence are rated separately, each with its own reason.

History events are never edited or deleted. Each stores the hash of the one before, so a later change breaks the chain.

Corrections keep the value before and after.