GHSA-xcpm-76hf-c9cc
low
Borrowck Scarifices exposes uninitialized memory in any_as_u8_slice
- Severity
- low CVSS:4.0 by GitHub
- Published
- Last changed
- Also known as
- RUSTSEC-2025-0107
Description
The safe function any_as_u8_slice can create byte slices that reference uninitialized memory when used with types containing padding bytes.
The function uses slice::from_raw_parts to create a &[u8] covering the entire size of a type, including padding bytes. According to Rust's documentation, from_raw_parts requires all bytes to be properly initialized, but padding bytes in structs are not guaranteed to be initialized. This violates the safety contract and causes undefined behavior.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| borrowck_sacrifices (crates.io) | before 0.2.0, from 0.0.0-0 before 0.2.0 | GitHub Advisory Database, RustSec Advisory Database |
Classification
References
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-xcpm-76hf-c9cc changed 2025-10-28 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2025-0107 changed 2025-10-28 | CC0-1.0 |