# CVE-2020-35926: Improper random number generation in nanorand

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.53%, higher than 75% of CVEs (2026-12-01)
- Published: 2020-12-09T12:00:00.000Z
- Modified: 2026-06-17T03:14:37.220Z
- Also known as: GHSA-m9m5-cg5h-r582, RUSTSEC-2020-0089
- Weaknesses: CWE-330, CWE-338, CWE-681
- Assigned by: mitre

## Description

An issue was discovered in the nanorand crate before 0.5.1 for Rust. It caused any random number generator (even ChaCha) to return all zeroes because integer truncation was mishandled.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- nanorand (crates.io): before 0.5.1; from 0.0.0-0 before 0.5.1
- nanorand_project nanorand: before 0.5.1

## Every score

- GitHub: CVSS:3.1 5.1 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N`
- RustSec Advisory Database: CVSS:3.1 5.1 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://rustsec.org/advisories/RUSTSEC-2020-0089.html> (advisory, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2020-35926> (advisory)
- <https://github.com/Absolucy/nanorand-rs/commit/5ba218ac29df4786b002d7d12b47fa0c04a331f2> (web)
- <https://github.com/Absolucy/nanorand-rs> (package)
- <https://twitter.com/aspenluxxxy/status/1336684692284772352> (web)
- <https://crates.io/crates/nanorand> (package)

## Sources

- CVE List: [CVE-2020-35926](https://www.cve.org/CVERecord?id=CVE-2020-35926), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-m9m5-cg5h-r582](https://github.com/advisories/GHSA-m9m5-cg5h-r582), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2020-0089](https://rustsec.org/advisories/RUSTSEC-2020-0089.html), CC0-1.0, modified 2023-11-08
- NVD: [CVE-2020-35926](https://nvd.nist.gov/vuln/detail/CVE-2020-35926), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2020-35926 · Whole record: https://cve.day/CVE-2020-35926.json · Rebuilt by cve.day 2026-11-25T22:57:56.660Z
