Low, CVSS 2.0crates.ioPublished
Borrowck Scarifices exposes uninitialized memory in any_as_u8_slice
GHSA-xcpm-76hf-c9cc
- Affected
- crates.io borrowck_sacrifices < 0.2.0
- Fixed in
- 0.2.0· Vendor fix available
- Issue
- The safe function anyasu8slice can create byte slices that reference uninitialized memory when used with types containing padding bytes. The function uses slice::fromrawparts to create a &[u8] covering the entire size of a type, including padding bytes. According to Rust's documentation, fromrawparts 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.
Recommended action: Upgrade to 0.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.