NetSight
low2.0No CVE yet

GHSA-xcpm-76hf-c9cc

Borrowck Scarifices exposes uninitialized memory in any_as_u8_slice

Impact

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.

An attacker can exploit this with local access to the system, without logging in, without any action by a user. If it succeeds: low risk of outages.

Affected packages

EcosystemPackageAffectedFixed in
rustborrowck_sacrifices< 0.2.00.2.0

Weakness classification

References