Advisory

RUSTSEC-2021-0023

Also known as: CVE-2021-27378, GHSA-w7j2-35mf-95p7

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.

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.

Severity

Critical Basis: CVSS v3 score 9.8, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Dates

Published
2021-02-12 12:00 UTC
Modified
2023-11-08 04:05 UTC

Affected packages and fixes

rand_core

crates.io · All systems

Affected

  • introduced 0.6.0, fixed 0.6.2 (semver)

Fixed versions

0.6.2

Fix

  • Fixed version 0.6.2
    cargo update -p rand_core --precise 0.6.2

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences