Rust advisories / borrowck_sacrifices
Unsound LowRUSTSEC-2025-0107 · borrowck_sacrifices
RUSTSEC-2025-0107: Uninitialized memory exposure in any_as_u8_slice
Short answerborrowck_sacrifices has an API that can cause undefined behaviour from safe code: Uninitialized memory exposure in any_as_u8_slice. Fixed in 0.2.0.
| Crate | borrowck_sacrifices |
|---|---|
| Type | Unsound (memory-exposure) |
| Affected versions | Before 0.2.0. |
| Fixed in | 0.2.0 |
| Severity | Low (GitHub rating) |
| Published | 2025-10-21 |
| Last changed | 2025-10-28 |
| Also known as | GHSA-xcpm-76hf-c9cc |
| Affected functions | borrowck_sacrifices::unsafe_casts::any_as_u8_slice |
What to do
- See which version you have:
cargo tree -i borrowck_sacrifices(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p borrowck_sacrifices. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for exampleborrowck_sacrifices = "0.2.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
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.
References
- Package: crates.io/crates/borrowck_sacrifices
- Advisory: rustsec.org/advisories/RUSTSEC-2025-0107.html
- Report: github.com/alexpyattaev/borrowck_sacrifices/issues/1
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?