{"id":"CVE-2020-35926","aliases":["CVE-2020-35926","GHSA-m9m5-cg5h-r582","RUSTSEC-2020-0089"],"related":[],"kind":"vulnerability","state":"published","title":"Improper random number generation in nanorand","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"In versions of `nanorand` prior to 0.5.1, `RandomGen` implementations for standard unsigned integers could\nfail to properly generate numbers, due to using bit-shifting to truncate a 64-bit number, rather than just\nan `as` conversion.\n\nThis often manifested as RNGs returning nothing but 0, including the cryptographically secure `ChaCha` random\nnumber generator..","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate nanorand versiones anteriores a 0.5.1 para Rust.&#xa0;Causó que cualquier generador de números aleatorios (incluso ChaCha) devolviera todos los ceros porque el truncamiento de enteros se manejó inapropiadamente.","source":"nvd"}],"published":"2020-12-09T12:00:00.000Z","modified":"2026-06-17T03:14:37.220Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":5.1,"rating":"MEDIUM"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":5.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-330","CWE-338","CWE-681"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.5.1"}],"ecosystem":"crates.io","package":"nanorand","purl":"pkg:cargo/nanorand","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.5.1"}],"ecosystem":"crates.io","package":"nanorand","purl":"pkg:cargo/nanorand","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.5.1"}],"vendor":"nanorand_project","product":"nanorand","cpe":"cpe:2.3:a:nanorand_project:nanorand:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2020-0089.html","tags":["advisory","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-35926","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Absolucy/nanorand-rs/commit/5ba218ac29df4786b002d7d12b47fa0c04a331f2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/Absolucy/nanorand-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://twitter.com/aspenluxxxy/status/1336684692284772352","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/nanorand","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-35926","url":"https://www.cve.org/CVERecord?id=CVE-2020-35926","licence":"CVE Terms of Use","modified":"2024-08-04T17:16:13.237Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m9m5-cg5h-r582","url":"https://github.com/advisories/GHSA-m9m5-cg5h-r582","licence":"CC-BY-4.0","modified":"2023-11-08T04:03:39.769Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2020-0089","url":"https://rustsec.org/advisories/RUSTSEC-2020-0089.html","licence":"CC0-1.0","modified":"2023-11-08T04:03:39.769Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-35926","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-35926","licence":"Public domain","modified":"2026-06-17T03:14:37.220Z"}],"updatedAt":"2026-11-25T22:57:56.660Z","epss":{"score":0.01534,"percentile":0.75555,"date":"2026-12-01T12:00:22.000Z"}}