Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. rand_core
  4. ›
  5. CVE-2020-25576

CVE-2020-25576: Unaligned memory access in rand_core

August 25, 2021

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.

References

  • github.com/advisories/GHSA-mmc9-pwm7-qj5w
  • github.com/rust-random/rand
  • github.com/rust-random/rand/blob/master/rand_core/CHANGELOG.md
  • github.com/rust-random/rand/security/advisories/GHSA-mmc9-pwm7-qj5w
  • nvd.nist.gov/vuln/detail/CVE-2020-25576
  • rustsec.org/advisories/RUSTSEC-2019-0035.html

Code Behaviors & Features

Detect and mitigate CVE-2020-25576 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.3.1, all versions starting from 0.4.0 before 0.4.2

Fixed versions

  • 0.4.2
  • 0.3.1

Solution

Upgrade to versions 0.3.1, 0.4.2 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-704: Incorrect Type Conversion or Cast

Source file

cargo/rand_core/CVE-2020-25576.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:17:00 +0000.