RUSTSEC-2026-0097: Rand is unsound with a custom logger using `rand::rng()`
Los mantenedores suelen responder en 4 días
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 18/100
Línea de trabajo
Start by reading the linked rand advisory at https://github.com/rust-random/rand/pull/1763 and check how this repository depends on or configures rand. The report describes undefined behavior in rand under specific logger and feature conditions but does not say what change this repository should make. Done is unclear from the issue text alone.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
| Details | |
|---|---|
| Package | rand |
| Version | 0.8.5 |
| Warning | unsound |
| URL | https://github.com/rust-random/rand/pull/1763 |
| Patched Versions | >=0.10.1 OR <0.10.0, >=0.9.3 OR <0.9.0, >=0.8.6 |
| Unaffected Versions | <0.7.0 |
| Aliases | GHSA-cq8v-f236-94qc |
It has been reported (by @lopopolo) that the rand library is unsound (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:
- The
logandthread_rngfeatures are enabled - A custom logger is defined
- The custom logger accesses
rand::rng()(previouslyrand::thread_rng()) and calls anyTryRng(previouslyRngCore) methods onThreadRng - 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
getrandomcrate) 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, the behaviour of optimized builds is hard to predict.
- Lenguaje dominante
- Rust
- Estrellas
- 10
- Forks
- 8
- Merge medio
- 6 d 3 h
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bitcoindevkit/electrum_streaming_client
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
bitcoindevkit/electrum_streaming_client#68 ·
Los mantenedores suelen responder en 4 días
-
RUSTSEC-2026-0386: `AsyncFd::new` and related constructors violate I/O safetyPosiblemente ocupada @noahjoeris la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
bitcoindevkit/electrum_streaming_client#57 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
bitcoindevkit/electrum_streaming_client#56 ·
Los mantenedores suelen responder en 4 días
-
GetTx documentationAbiertodocumentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
bitcoindevkit/electrum_streaming_client#29 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
bitcoindevkit/electrum_streaming_client#69 ·
Los mantenedores suelen responder en 4 días
Todos los issues de bitcoindevkit/electrum_streaming_client
Issues similares
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mozilla-services/syncstorage-rs#2715 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
physicsdolphin/nv-uefi-unlocker#53 · 4 reacciones ·
Los mantenedores suelen responder en 1 día