Vulnerability DatabaseRUSTSEC-2025-0107

RUSTSEC-2025-0107
Rust vulnerability analysis and mitigation

Overview

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

Technical details

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

Impact

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

Mitigation and workarounds

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

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-62518HIGH8.1
  • RustRust
  • rust-astral-tokio-tar
NoYesOct 21, 2025
GHSA-fp5x-7m4q-449fLOW2
  • RustRust
  • direct_ring_buffer
NoYesOct 21, 2025
GHSA-h5j3-crg5-8jqmLOW2
  • RustRust
  • orx-pinned-vec
NoYesOct 21, 2025
RUSTSEC-2025-0107N/AN/A
  • RustRust
  • borrowck_sacrifices
NoYesOct 21, 2025
RUSTSEC-2025-0106N/AN/A
  • RustRust
  • orx-pinned-vec
NoYesOct 21, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management