CVE-2020-25576
Unaligned memory access in rand_core
An issue was discovered in the rand_core crate before 0.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.
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.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.
- Record
CVE-2020-25576- 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-704
- Updated
- 2026-11-02
CVE List No score
An issue was discovered in the rand_core crate before 0.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.
- Record
CVE-2020-25576- Updated
- 2026-11-02
EUVDEUVD-2021-1804 No score
An issue was discovered in the rand_core crate before 0.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.
- Record
EUVD-2021-1804- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-mmc9-pwm7-qj5w
9.8
Unaligned memory access in rand_core
Impact
Affected versions of this crate violated alignment when casting byte slices to integer slices, resulting in undefined behavior. rand_core::BlockRng::next_u64 and rand_core::BlockRng::fill_bytes are affected.
Patches
The flaw was corrected by Ralf Jung and Diggory Hardy for rand_core >= 0.4.2.
Workarounds
None.
References
See Rand's changelog.
For more information
If you have any questions or comments about this advisory, open an issue in the Rand repository.
- Record
GHSA-mmc9-pwm7-qj5w- 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-704
- Updated
- 2026-11-02
OSVAZL-46540
9.8
CVE-2020-25576 affecting package kata-containers for versions less than 3.2.0.azl2-3
An issue was discovered in the rand_core crate before 0.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.
- Record
AZL-46540- 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.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.
- Record
CVE-2020-25576- 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
OSVDEBIAN-CVE-2020-25576
9.8
An issue was discovered in the rand_core crate before 0.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.
- Record
DEBIAN-CVE-2020-25576- 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
OSVGHSA-mmc9-pwm7-qj5w
9.8
Unaligned memory access in rand_core
Impact
Affected versions of this crate violated alignment when casting byte slices to integer slices, resulting in undefined behavior. rand_core::BlockRng::next_u64 and rand_core::BlockRng::fill_bytes are affected.
Patches
The flaw was corrected by Ralf Jung and Diggory Hardy for rand_core >= 0.4.2.
Workarounds
None.
References
See Rand's changelog.
For more information
If you have any questions or comments about this advisory, open an issue in the Rand repository.
- Record
GHSA-mmc9-pwm7-qj5w- 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-704
- Updated
- 2026-11-02
OSVRUSTSEC-2019-0035
9.8
Unaligned memory access
Affected versions of this crate violated alignment when casting byte slices to integer slices, resulting in undefined behavior.
The flaw was corrected by Ralf Jung and Diggory Hardy.
- Record
RUSTSEC-2019-0035- 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-2020-25576
9.8
An issue was discovered in the rand_core crate before 0.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.
- Record
UBUNTU-CVE-2020-25576- 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
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
rand_corecrates.io |
0.4.0 up to 0.4.2 | 0.4.2 |
rand_corecrates.io |
before 0.3.1 | 0.3.1 |
kata-containersAzure Linux:3 |
before 3.2.0.azl2-3 | 3.2.0.azl2-3 |
rust-rand-coreDebian:12 |
before 0.5.0-1 | 0.5.0-1 |
rust-rand-coreDebian:13 |
before 0.5.0-1 | 0.5.0-1 |
rust-rand-coreDebian:14 |
before 0.5.0-1 | 0.5.0-1 |
rand_corecrates.io |
0.0.0-0 up to 0.3.1, 0.4.0-0 up to 0.4.2 | 0.3.10.4.2 |
rust-rand-core-0.2Ubuntu:20.04:LTS |
All versions, plus listed versions 0.2.2-10.2.2-2 |
None known |
rust-rand-core-0.3Ubuntu:20.04:LTS |
All versions, plus listed versions 0.3.0-10.3.0-2 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| 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-2020-25576 is a critical vulnerability (CVSS 9.8) in Rust-random Rand, published April 19, 2019. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.60%, the 75th percentile. Fixed in rand_core 0.4.2.
References
rustsec.org/advisories/RUSTSEC-2019-0035.html
github.com/rust-random/rand/security/advisories/GHSA-mmc9-pwm7-qj5w
github.com/rust-random/rand/blob/master/rand_core/CHANGELOG.md
github.com/advisories/GHSA-mmc9-pwm7-qj5w
nvd.nist.gov/vuln/detail/CVE-2020-25576
security-tracker.debian.org/tracker/CVE-2020-25576