{"id":"CVE-2021-27378","aliases":["CVE-2021-27378","GHSA-w7j2-35mf-95p7","RUSTSEC-2021-0023"],"related":[],"kind":"vulnerability","state":"published","title":"Incorrect check on buffer length in rand_core","summary":"An issue was discovered in the rand_core crate before 0.6.2 for Rust. Because read_u32_into and read_u64_into mishandle certain buffer-length checks, a random number generator may be seeded with too little data.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the rand_core crate before 0.6.2 for Rust. Because read_u32_into and read_u64_into mishandle certain buffer-length checks, a random number generator may be seeded with too little data.","source":"cvelist"},{"lang":"en","text":"An issue was discovered in the rand_core crate before 0.6.2 for Rust. Because `read_u32_into` and `read_u64_into` mishandle certain buffer-length checks, a random number generator may be seeded with too little data. The vulnerability was introduced in v0.6.0. The advisory doesn't apply to earlier minor version numbers.\n\nBecause read_u32_into and read_u64_into mishandle certain buffer-length checks, a random number generator may be seeded with too little data.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Summary: rand_core::le::read_u32_into and read_u64_into have incorrect checks on the source buffer length, allowing the destination buffer to be under-filled.\n\nImplications: some downstream RNGs, including Hc128Rng (but not the more widely used ChaCha*Rng), allow seeding using the SeedableRng::from_seed trait-function with too short keys.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate rand_core versiones anteriores a 0.6.2 para Rust.&#xa0;Debido a que las funciones read_u32_into y read_u64_into manejan inapropiadamente determinadas comprobaciones de la longitud del búfer, un generador de números aleatorios puede ser sembrado con muy pocos datos","source":"nvd"}],"published":"2021-02-12T12:00:00.000Z","modified":"2026-06-17T03:44:44.323Z","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-131","CWE-330"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.6.0","status":"affected","fixed":"0.6.2"}],"ecosystem":"crates.io","package":"rand_core","purl":"pkg:cargo/rand_core","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.6.0","status":"affected","fixed":"0.6.2"}],"ecosystem":"crates.io","package":"rand_core","purl":"pkg:cargo/rand_core","source":"rustsec"},{"ranges":[{"status":"affected","introduced":"0.6.0","fixed":"0.6.2"}],"vendor":"rand_core_project","product":"rand_core","cpe":"cpe:2.3:a:rand_core_project:rand_core:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0023.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-2021-27378","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rust-random/rand/pull/1096","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/rust-random/rand","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rust-random/rand/compare/0.6.0...rand_core-0.6.2#diff-f41b3dfa5ce28f3bee390d327c50621e141cf3569921f8e9ca15ccfcf25263a9R19","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rust-random/rand/compare/0.6.0...rand_core-0.6.2#diff-f41b3dfa5ce28f3bee390d327c50621e141cf3569921f8e9ca15ccfcf25263a9R28","tags":["web"],"sources":["ghsa"]},{"url":"https://crates.io/crates/rand_core","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-27378","url":"https://www.cve.org/CVERecord?id=CVE-2021-27378","licence":"CVE Terms of Use","modified":"2024-08-03T20:48:16.403Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w7j2-35mf-95p7","url":"https://github.com/advisories/GHSA-w7j2-35mf-95p7","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:24.551Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0023","url":"https://rustsec.org/advisories/RUSTSEC-2021-0023.html","licence":"CC0-1.0","modified":"2023-11-08T04:05:24.551Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-27378","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-27378","licence":"Public domain","modified":"2026-06-17T03:44:44.323Z"}],"updatedAt":"2026-11-25T22:57:59.984Z","epss":{"score":0.01253,"percentile":0.70295,"date":"2026-12-01T12:00:22.000Z"}}