GHSA-h7h7-6mx3-r89v: Fyrox has unsound usages of `Vec::from_raw_parts`
The library provides a public safe API transmutevecasbytes, which incorrectly assumes that any generic type T could have stable layout, causing to uninitialized memory exposure if the users pass any types with padding bytes as T and cast it to u8 pointer. In the issue, we develop a PoC to show passing struct type to transmutevecasbytes could lead to undefined behavior with Vec::fromrawparts.
Published Feb 14, 2025
Affected packages
fyrox-core
- Ecosystem
- Rust (crates.io)
- Affected
- >= 0.28.1, < 0.36
- Fixed in
- 0.36
- Check
cargo tree -i fyrox-core
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
The library provides a public safe API transmute_vec_as_bytes, which incorrectly assumes that any generic type T could have stable layout, causing to uninitialized memory exposure if the users pass any types with padding bytes as T and cast it to u8 pointer.
In the issue, we develop a PoC to show passing struct type to transmute_vec_as_bytes could lead to undefined behavior with Vec::from_raw_parts.
The developers provide a patch by changing trait of Copy to Pod, which can make sure T should be plain data. This was patched in the latest version of master branch, but still not on the latest release (0.28.1).
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
