GHSA-xcpm-76hf-c9cc Borrowck Scarifices exposes uninitialized memory in any_as_u8_slice
LowCVSS 2.0
- Published
- Updated
- Exploit status
- No public exploit known
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.
Upgrade path
1 package: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| crates.io borrowck_sacrifices(crates.io) | < 0.2.0; >= 0.0.0-0, < 0.2.0 | 0.2.0 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| crates.io borrowck_sacrifices(crates.io) | < 0.2.0 | 0.2.0 |
| crates.io borrowck_sacrifices(crates.io) | >= 0.0.0-0, < 0.2.0 | 0.2.0 |
References
- github.com issue-tracking
- github.com patch
- github.com product
- rustsec.org vendor-advisory
- crates.io product
- github.com