rand_core known bugs
cargo4 known bugs in rand_core, with affected versions, fixes and workarounds. Sourced from upstream issue trackers.
4
bugs
Known bugs
| Severity | Affected | Fixed in | Title | Status | Source |
|---|---|---|---|---|---|
| medium | 0.6.0 | 0.6.2 | Incorrect check on buffer length when seeding RNGs Summary: rand_core::le::read_u32_into and read_u64_into have incorrect checks on the source buffer length, allowing the destination buffer to be under-filled.
Implications: some downstream RNGs, including Hc128Rng (but not the more widely used ChaCha*Rng), allow seeding using the SeedableRng::from_seed trait-function with too short keys. | fixed | osv:RUSTSEC-2021-0023 |
| medium | 0.4.0-0 | 0.4.2 | 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. | fixed | osv:RUSTSEC-2019-0035 |
| critical | 0.6.0 | 0.6.2 | Incorrect check on buffer length in rand_core An issue was discovered in the rand_core crate before 0.6.2 for Rust. Because `read_u32_into` and `read_u64_into` mishandle certain buffer-length checks, a random number generator may be seeded with too little data. The vulnerability was introduced in v0.6.0. The advisory doesn't apply to earlier minor version numbers.
Because read_u32_into and read_u64_into mishandle certain buffer-length checks, a random number generator may be seeded with too little data. | fixed | osv:GHSA-w7j2-35mf-95p7 |
| critical | 0.4.0 | 0.4.2 | 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](https://github.com/rust-random/rand/blob/master/rand_core/CHANGELOG.md#050---2019-06-06).
### For more information
If you have any questions or comments about this advisory, [open an issue in the Rand repository](https://github.com/rust-random/rand/issues/new/choose).
| fixed | osv:GHSA-mmc9-pwm7-qj5w |
API access
Get this data programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/bugs/cargo/rand_core