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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| rand_core (crates.io) | from 0.6.0 before 0.6.2 | GitHub Advisory Database, RustSec Advisory Database |
| rand_core_project rand_core | from 0.6.0 before 0.6.2 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| RustSec Advisory Database | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV: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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-27378 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-w7j2-35mf-95p7 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0023 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-27378 changed 2026-06-17 | Public domain |