Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

rust-random/rand_core
master @ 5cd7df4
1
Fixes
1
CVEs
CRITICAL
Peak severity
Highlights
Memory Safety: 1 prior fix. Scrutinize any change in this area.
src/lib.rs: most-fixed (1 issue). Treat as high-risk during review.
1 high-severity fix in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Memory Safety: Unsafe pointer arithmetic and raw memory copying (copy_nonoverlapping) inside SeedableRng::seed_from_u64 can lead to out-of-bounds writes if the destination buffer is not properly sized relative to the input u64 payload. Replacing these operations with safe abstractions like copy_from_slice prevents memory corruption.
Incorrect Calculation: Mishandling of buffer-length checks in read_u32_into and read_u64_into can cause generators to be seeded with insufficient or predictable data when an attacker can control the seed input length.