From 221ec336f96413fe3ae90a6c19de750a76374f28 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Mon, 15 Feb 2021 15:31:38 +0000 Subject: [PATCH] rand_core: incorrect check on buffer length when seeding RNGs (#764) --- crates/rand_core/RUSTSEC-0000-0000.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 crates/rand_core/RUSTSEC-0000-0000.md diff --git a/crates/rand_core/RUSTSEC-0000-0000.md b/crates/rand_core/RUSTSEC-0000-0000.md new file mode 100644 index 0000000..61a3a36 --- /dev/null +++ b/crates/rand_core/RUSTSEC-0000-0000.md @@ -0,0 +1,24 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "rand_core" +date = "2021-02-12" +url = "https://github.com/rust-random/rand/pull/1096" +categories = ["crypto-failure"] +keywords = [] + +# Optional: metadata which narrows the scope of what this advisory affects +[affected.functions] +"rand_core::le::read_u32_into" = ["< 0.6.2, >= 0.6.0"] +"rand_core::le::read_u64_into" = ["< 0.6.2, >= 0.6.0"] + +[versions] +patched = [">= 0.6.2"] +unaffected = ["< 0.6.0"] +``` + +# Incorrect check on buffer length when seeding RNGs + +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. + +Implications: 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.