{"id":"CVE-2020-25576","aliases":["CVE-2020-25576","GHSA-mmc9-pwm7-qj5w","RUSTSEC-2019-0035"],"related":[],"kind":"vulnerability","state":"published","title":"Unaligned memory access in rand_core","summary":"An issue was discovered in the rand_core crate before 0.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the rand_core crate before 0.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.","source":"cvelist"},{"lang":"en","text":"### Impact\nAffected versions of this crate violated alignment when casting byte slices to integer slices, resulting in undefined behavior. `rand_core::BlockRng::next_u64` and `rand_core::BlockRng::fill_bytes` are affected.\n\n### Patches\nThe flaw was corrected by Ralf Jung and Diggory Hardy for `rand_core >= 0.4.2`.\n\n### Workarounds\nNone.\n\n### References\nSee [Rand's changelog](https://github.com/rust-random/rand/blob/master/rand_core/CHANGELOG.md#050---2019-06-06).\n\n### For more information\nIf you have any questions or comments about this advisory, [open an issue in the Rand repository](https://github.com/rust-random/rand/issues/new/choose).","format":"markdown","source":"ghsa"},{"lang":"en","text":"Affected versions of this crate violated alignment when casting byte slices to\ninteger slices, resulting in undefined behavior.\n\nThe flaw was corrected by Ralf Jung and Diggory Hardy.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate rand_core versiones anteriores a 0.4.2 para Rust.&#xa0;La conversión de segmentos de bytes a segmentos de enteros maneja inapropiadamente las restricciones de alineación","source":"nvd"}],"published":"2019-04-19T12:00:00.000Z","modified":"2026-08-19T19:21:55.070Z","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:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"RustSec Advisory Database","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: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-704"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.4.0","status":"affected","fixed":"0.4.2"}],"ecosystem":"crates.io","package":"rand_core","purl":"pkg:cargo/rand_core","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.3.1"}],"ecosystem":"crates.io","package":"rand_core","purl":"pkg:cargo/rand_core","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.3.1"},{"type":"semver","introduced":"0.4.0-0","status":"affected","fixed":"0.4.2"}],"ecosystem":"crates.io","package":"rand_core","purl":"pkg:cargo/rand_core","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.4.2"}],"vendor":"rust-random","product":"rand","cpe":"cpe:2.3:a:rust-random:rand:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2019-0035.html","tags":["advisory","vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://github.com/rust-random/rand/security/advisories/GHSA-mmc9-pwm7-qj5w","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rust-random/rand","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rust-random/rand/blob/master/rand_core/CHANGELOG.md#050---2019-06-06","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/rand_core","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-25576","url":"https://www.cve.org/CVERecord?id=CVE-2020-25576","licence":"CVE Terms of Use","modified":"2024-08-04T15:33:05.759Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mmc9-pwm7-qj5w","url":"https://github.com/advisories/GHSA-mmc9-pwm7-qj5w","licence":"CC-BY-4.0","modified":"2023-11-08T04:03:10.161Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2019-0035","url":"https://rustsec.org/advisories/RUSTSEC-2019-0035.html","licence":"CC0-1.0","modified":"2023-11-08T04:03:10.161Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-25576","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-25576","licence":"Public domain","modified":"2026-08-19T19:21:55.070Z"}],"updatedAt":"2026-11-25T22:57:54.696Z","epss":{"score":0.01602,"percentile":0.76534,"date":"2026-12-01T12:00:22.000Z"}}