CVE-2021-27378
JSON

9.8critical

Incorrect check on buffer length in rand_core

Severity
9.8critical CVSS:3.1 by NVD
Exploit likelihood
1.25% (higher than 70% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-w7j2-35mf-95p7RUSTSEC-2021-0023

Description

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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
rand_core (crates.io)from 0.6.0 before 0.6.2GitHub Advisory Database, RustSec Advisory Database
rand_core_project rand_corefrom 0.6.0 before 0.6.2NVD

All scores

GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
RustSec Advisory Database9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV:N/AC:L/Au:N/C:P/I:P/A:P

Classification

What each source says

CVE List

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.

GitHub Advisory Database

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.

Because read_u32_into and read_u64_into mishandle certain buffer-length checks, a random number generator may be seeded with too little data.

RustSec Advisory Database

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.

NVD (es)

Se detectó un problema en la crate rand_core versiones anteriores a 0.6.2 para Rust. 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

References

Sources

SourceRecordLicence
CVE ListCVE-2021-27378 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-w7j2-35mf-95p7 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0023 changed 2023-11-08CC0-1.0
NVDCVE-2021-27378 changed 2026-06-17Public domain