{"id":"RUSTSEC-2021-0023","summary":"Incorrect check on buffer length when seeding RNGs","details":"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.","aliases":["CVE-2021-27378","GHSA-w7j2-35mf-95p7"],"modified":"2023-11-08T04:05:24.551510Z","published":"2021-02-12T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/rand_core"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2021-0023.html"},{"type":"WEB","url":"https://github.com/rust-random/rand/pull/1096"}],"affected":[{"package":{"name":"rand_core","ecosystem":"crates.io","purl":"pkg:cargo/rand_core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.6.0"},{"fixed":"0.6.2"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"functions":["rand_core::le::read_u32_into","rand_core::le::read_u64_into"],"os":[],"arch":[]}},"database_specific":{"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0023.json","categories":["crypto-failure"],"informational":null,"cvss":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}