CVE-2021-27378 Incorrect check on buffer length in rand_core

Critical 9.8 Published Updated

Insufficient buffer checks in rand_core allow seeding with too little data, weakening random number generation security.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-27378?

CVE-2021-27378 is a critical vulnerability in n/a, published on 18 Feb 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

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

Weakness: CWE-131

Which versions are affected by CVE-2021-27378?

3 open source packages ship an affected version, including rand_core. It affects 1 product.

PackageAffectedFixed in
rand_core crates.ioFrom 0.6.00.6.2
rand_core crates.ioFrom 0.6.00.6.2
rand_core crates.ioFrom 0.6.00.6.2

Products include Rand Core Project Rand Core.

How do I fix CVE-2021-27378?

Upgrade rand_core to 0.6.2 or later.

Is CVE-2021-27378 being exploited?

There is no known exploitation of CVE-2021-27378 in the wild and no public exploit code.

Sources

Also known as AZL-41851, GHSA-w7j2-35mf-95p7, RUSTSEC-2021-0023, UBUNTU-CVE-2021-27378.

Is CVE-2021-27378 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free