
Cloud Vulnerability DB
A community-led vulnerabilities database
A potential soundness issue was identified in the unsafecasts::anyasu8slice function of the borrowcksacrifices crate. The vulnerability was discovered on October 15, 2025, affecting the function that creates byte slices from arbitrary types. The issue occurs when the function is used with types containing padding bytes, which can lead to undefined behavior by creating references to uninitialized memory ([GitHub Issue](https://github.com/alexpyattaev/borrowcksacrifices/issues/1)).
The vulnerability exists in the anyasu8slice<'a,T: Sized> function implementation that uses unsafe Rust code to create a byte slice from any sized type. The function uses core::slice::fromrawparts to create a reference to the memory representation of the input value, but it doesn't account for potential padding bytes in struct layouts. According to the Rustonomicon and official documentation, creating references to uninitialized memory (padding bytes) is Undefined Behavior ([GitHub Issue](https://github.com/alexpyattaev/borrowcksacrifices/issues/1)).
When the vulnerable function is used with structs that contain padding bytes, it can lead to undefined behavior in the program. This can potentially result in memory safety violations and unpredictable program behavior. The issue was verified using Miri, the Rust interpreter, which detected the undefined behavior when accessing uninitialized padding bytes (GitHub Issue).
The suggested mitigation is to change the function signature to include an explicit unsafe marker (pub unsafe fn anyasu8slice), making the API contract more explicit about its potential dangers and requiring users to acknowledge the unsafe behavior ([GitHub Issue](https://github.com/alexpyattaev/borrowcksacrifices/issues/1)).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."