---
id: CVE-2020-25576
title: An issue was discovered in the rand_core crate before 0.4.2 for Rust
summary: >-
  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.
severity: critical
cvss: 9.8
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'
cwe:
  - CWE-704
vendor: rust-random
product: rand
affected:
  - rand < 0.4.2
patched:
  - rand 0.4.2
published: '2020-09-14'
updated: '2026-08-19'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2020-25576'
references:
  - url: 'https://rustsec.org/advisories/RUSTSEC-2019-0035.html'
    label: cve@mitre.org
  - url: 'https://rustsec.org/advisories/RUSTSEC-2019-0035.html'
    label: af854a3a-2127-422b-91ae-364da2661108
tags:
  - nvd
epss: 0.01558
epssPercentile: 0.74116
ingestedAt: '2026-08-20T17:59:03.078Z'
---

## Overview

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.

## Affected

- `rand < 0.4.2`

## Remediation

Upgrade past the affected range:

- `rand 0.4.2`
