CVE-2021-27378
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.
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
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 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV: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 Critical
CVSS: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 Critical
CVSS: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 Critical
CVSS: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 Critical
CVSS: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 Critical
CVSS: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 Critical
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
rand_corecrates.io |
0.6.0 up to 0.6.2 | 0.6.2 |
librsvg2Azure Linux:3 |
before 2.58.1-1 | 2.58.1-1 |
rust-rand-coreUbuntu:20.04:LTS |
All versions, plus listed versions 0.3.0-10.5.1-1 |
None known |
rust-rand-coreUbuntu:22.04:LTS |
All versions, plus listed versions 0.5.1-10.6.3-2 |
None known |
rust-rand-coreUbuntu:24.04:LTS |
All versions, plus listed versions 0.6.3-20.6.4-1 |
None known |
rust-rand-coreUbuntu:25.10 |
All versions, plus listed versions 0.6.4-2 |
None known |
rust-rand-coreUbuntu:26.10 |
All versions, plus listed versions 0.6.4-20.10.0-2 |
None known |
rust-rand-coreUbuntu:26.04:LTS |
All versions, plus listed versions 0.6.4-2 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| facts | ||
| aliases | EUVD | |
| first indexed | CVE 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
rustsec.org/advisories/RUSTSEC-2021-0023.html
nvd.nist.gov/vuln/detail/CVE-2021-27378
github.com/rust-random/rand/pull/1096
github.com/rust-random/rand/compare/0.6.0...rand_core-0.6.2
github.com/advisories/GHSA-w7j2-35mf-95p7
github.com/rust-random/rand
Show 10 moreShow less
crates.io/crates/rand_core
ubuntu.com/security/CVE-2021-27378
cve.org/CVERecord?id=CVE-2021-27378
suse.com/security/cve/CVE-2020-35905
suse.com/security/cve/CVE-2020-36465
suse.com/security/cve/CVE-2021-27378
suse.com/security/cve/CVE-2021-32714
suse.com/security/cve/CVE-2021-32715
suse.com/security/cve/CVE-2021-38191
suse.com/security/cve/CVE-2021-45710