# RUSTSEC-2025-0107: Uninitialized memory exposure in any\_as\_u8\_slice

- Database: RustSec
- Published: 2025-10-21
- Modified: 2025-10-28

## Also published as

- [GHSA-XCPM-76HF-C9CC](https://cve.now/GHSA-XCPM-76HF-C9CC.md) (GitHub)

## Affected versions

- borrowck\_sacrifices (crates.io): fixed in 0.2.0

## 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.

## References

- https://crates.io/crates/borrowck_sacrifices
- https://rustsec.org/advisories/RUSTSEC-2025-0107.html
- https://github.com/alexpyattaev/borrowck_sacrifices/issues/1

Page: https://cve.now/RUSTSEC-2025-0107

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
