Every CVE Search/ Get API key

CVE-2021-27378

Incorrect check on buffer length in rand_core

9.8 CriticalFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

1.24%Up 0.8 points since Apr 14, 2021
90%50%10%1%

What each source reports

NVD Score used 9.8

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.

Record
CVE-2021-27378
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
7.5 HighAV:N/AC:L/Au:N/C:P/I:P/A:P
Weakness
CWE-131
Updated
2026-11-02
CVE List No score

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.

Record
CVE-2021-27378
Updated
2026-11-02
EUVDEUVD-2021-1910 No score

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.

Record
EUVD-2021-1910
Updated
2026-11-03
GitHub AdvisoriesGHSA-w7j2-35mf-95p7 9.8

Incorrect check on buffer length in rand_core

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.

Record
GHSA-w7j2-35mf-95p7
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-330
Updated
2026-11-02
OSVAZL-41851 9.8

CVE-2021-27378 affecting package librsvg2 for versions less than 2.58.1-1

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.

Record
AZL-41851
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSV 9.8

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.

Record
CVE-2021-27378
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
Show 4 moreShow less
OSVGHSA-w7j2-35mf-95p7 9.8

Incorrect check on buffer length in rand_core

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.

Record
GHSA-w7j2-35mf-95p7
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-330
Updated
2026-11-02
OSVRUSTSEC-2021-0023 9.8

Incorrect check on buffer length when seeding RNGs

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.

Record
RUSTSEC-2021-0023
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2021-27378 9.8

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.

Record
UBUNTU-CVE-2021-27378
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVopenSUSE-SU-2024:11751-1 No score

afterburn-5.0.0-6.1 on GA media

These are all security issues fixed in the afterburn-5.0.0-6.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11751-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
rand_core
crates.io
0.6.0 up to 0.6.2
0.6.2
librsvg2
Azure Linux:3
before 2.58.1-1
2.58.1-1
rust-rand-core
Ubuntu:20.04:LTS
All versions, plus listed versions
0.3.0-10.5.1-1
None known
rust-rand-core
Ubuntu:22.04:LTS
All versions, plus listed versions
0.5.1-10.6.3-2
None known
rust-rand-core
Ubuntu:24.04:LTS
All versions, plus listed versions
0.6.3-20.6.4-1
None known
rust-rand-core
Ubuntu:25.10
All versions, plus listed versions
0.6.4-2
None known
rust-rand-core
Ubuntu:26.10
All versions, plus listed versions
0.6.4-20.10.0-2
None known
rust-rand-core
Ubuntu:26.04:LTS
All versions, plus listed versions
0.6.4-2
None known

History

History
RecordedChangedSources
facts
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-27378 is a critical vulnerability (CVSS 9.8) in Rand Core Project Core, published February 12, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.24%, the 69th percentile. Fixed in rand_core 0.6.2.

References

Show 10 moreShow less
MoveEnter Open