Vulnerability MediumRUSTSEC-2020-0089 · nanorand
RUSTSEC-2020-0089: nanorand 0.5.0 - RNGs failed to generate properly for non-64-bit numbers
Short answerA security vulnerability in the nanorand crate: nanorand 0.5.0 - RNGs failed to generate properly for non-64-bit numbers. Medium severity (CVSS 5.1). Fixed in 0.5.1: update to a fixed version.
| Crate | nanorand |
|---|---|
| Type | Vulnerability (crypto-failure) |
| Affected versions | Before 0.5.1. |
| Fixed in | 0.5.1 |
| Severity | Medium, CVSS 5.1 CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N |
| Published | 2020-12-09 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2020-35926, GHSA-m9m5-cg5h-r582 |
What to do
- See which version you have:
cargo tree -i nanorand(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p nanorand. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplenanorand = "0.5.1") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
In versions of nanorand prior to 0.5.1, RandomGen implementations for standard unsigned integers could fail to properly generate numbers, due to using bit-shifting to truncate a 64-bit number, rather than just an as conversion.
This often manifested as RNGs returning nothing but 0, including the cryptographically secure ChaCha random number generator..
References
- Package: crates.io/crates/nanorand
- Advisory: rustsec.org/advisories/RUSTSEC-2020-0089.html
- Web: twitter.com/aspenluxxxy/status/1336684692284772352
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for nanorand
Up next
Same cratenanorand: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?