CVE-2021-27378 json
Incorrect check on buffer length in rand_core
published 2021-02-12 5 y ago modified 2026-06-17 4 mo ago also GHSA-w7j2-35mf-95p7 , RUSTSEC-2021-0023 , EUVD-2021-1910
- cvss
- 9.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.2%
- EPSS 1.2% chance of exploitation in 30 days, percentile 69%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- crates.io rand_core 0.6.2
- rand_core_project rand_core 0.6.2
- github.com/rust-random/rand#1096 pull request
Exploit prediction
1.24% chance of exploitation in the next 30 days, higher than 69% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| OSV | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | rand_core | >=0.6.0, <0.6.2 |
0.6.2 |
Classification
References
-
github.com
/rust-random/rand/pull/1096
web
-
rustsec.org
/advisories/RUSTSEC-2021-0023.html
web, third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-27378
advisory
-
github.com
/rust-random/rand
package
-
github.com
/rust-random/rand/compare/0.6.0...rand_core-0.6.2#diff-f41b3dfa5ce28f3bee390d327c50621e141cf3569921f8e9ca15ccf
web
-
github.com
/rust-random/rand/compare/0.6.0...rand_core-0.6.2#diff-f41b3dfa5ce28f3bee390d327c50621e141cf3569921f8e9ca15ccf
web
-
crates.io
/crates/rand_core
package
Sources
- CVE List CVE-2021-27378
- GitHub Advisory GHSA-w7j2-35mf-95p7
- NVD CVE-2021-27378
- OSV RUSTSEC-2021-0023
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.