Every CVE Search/ Get API key

CVE-2020-25576

Unaligned memory access in rand_core

9.8 CriticalFix available

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

1.60%Up 1.2 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.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.

Record
CVE-2020-25576
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-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 CriticalCVSS: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 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.4.2 for Rust. Casting of byte slices to integer slices mishandles alignment constraints.

Record
CVE-2020-25576
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
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 CriticalCVSS: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 CriticalCVSS: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 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-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 CriticalCVSS: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

Affected packages
PackageAffectedFixed
rand_core
crates.io
0.4.0 up to 0.4.2
0.4.2
rand_core
crates.io
before 0.3.1
0.3.1
kata-containers
Azure Linux:3
before 3.2.0.azl2-3
3.2.0.azl2-3
rust-rand-core
Debian:12
before 0.5.0-1
0.5.0-1
rust-rand-core
Debian:13
before 0.5.0-1
0.5.0-1
rust-rand-core
Debian:14
before 0.5.0-1
0.5.0-1
rand_core
crates.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.2
Ubuntu:20.04:LTS
All versions, plus listed versions
0.2.2-10.2.2-2
None known
rust-rand-core-0.3
Ubuntu:20.04:LTS
All versions, plus listed versions
0.3.0-10.3.0-2
None known

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE 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

Show 4 moreShow less
MoveEnter Open