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

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.25%, higher than 70% of CVEs (2026-12-01)
- Published: 2021-02-12T12:00:00.000Z
- Modified: 2026-06-17T03:44:44.323Z
- Also known as: GHSA-w7j2-35mf-95p7, RUSTSEC-2021-0023
- Weaknesses: CWE-131, CWE-330
- Assigned by: mitre

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

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- rand_core (crates.io): from 0.6.0 before 0.6.2
- rand_core_project rand_core: from 0.6.0 before 0.6.2

## Every score

- GitHub: 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`
- RustSec Advisory Database: 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`
- NVD: 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`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://rustsec.org/advisories/RUSTSEC-2021-0023.html> (advisory, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-27378> (advisory)
- <https://github.com/rust-random/rand/pull/1096> (web)
- <https://github.com/rust-random/rand> (package)
- <https://github.com/rust-random/rand/compare/0.6.0...rand_core-0.6.2#diff-f41b3dfa5ce28f3bee390d327c50621e141cf3569921f8e9ca15ccfcf25263a9R19> (web)
- <https://github.com/rust-random/rand/compare/0.6.0...rand_core-0.6.2#diff-f41b3dfa5ce28f3bee390d327c50621e141cf3569921f8e9ca15ccfcf25263a9R28> (web)
- <https://crates.io/crates/rand_core> (package)

## Sources

- CVE List: [CVE-2021-27378](https://www.cve.org/CVERecord?id=CVE-2021-27378), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-w7j2-35mf-95p7](https://github.com/advisories/GHSA-w7j2-35mf-95p7), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2021-0023](https://rustsec.org/advisories/RUSTSEC-2021-0023.html), CC0-1.0, modified 2023-11-08
- NVD: [CVE-2021-27378](https://nvd.nist.gov/vuln/detail/CVE-2021-27378), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-27378 · Whole record: https://cve.day/CVE-2021-27378.json · Rebuilt by cve.day 2026-11-25T22:57:59.984Z
