Skip to content

Incorrect check on buffer length in rand_core

Critical severity GitHub Reviewed Published Aug 25, 2021 to the GitHub Advisory Database • Updated Jun 13, 2023

Package

cargo rand_core (Rust)

Affected versions

>= 0.6.0, < 0.6.2

Patched versions

0.6.2

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. 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.

References

Published by the National Vulnerability Database Feb 18, 2021
Reviewed Aug 19, 2021
Published to the GitHub Advisory Database Aug 25, 2021
Last updated Jun 13, 2023

Severity

Critical
9.8
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Weaknesses

CVE ID

CVE-2021-27378

GHSA ID

GHSA-w7j2-35mf-95p7

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.