Fyrox has unsound usages of `Vec::from_raw_parts`
Low severity
GitHub Reviewed
Published
Feb 14, 2025
to the GitHub Advisory Database
•
Updated Feb 14, 2025
Description
Published to the GitHub Advisory Database
Feb 14, 2025
Reviewed
Feb 14, 2025
Last updated
Feb 14, 2025
The library provides a public safe API
transmute_vec_as_bytes
, which incorrectly assumes that any generic typeT
could have stable layout, causing to uninitialized memory exposure if the users pass any types with padding bytes asT
and cast it tou8
pointer.In the issue, we develop a PoC to show passing struct type to
transmute_vec_as_bytes
could lead to undefined behavior withVec::from_raw_parts
.The developers provide a patch by changing trait of
Copy
toPod
, which can make sureT
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