RUSTSEC-2024-0435

Source
https://rustsec.org/advisories/RUSTSEC-2024-0435
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2024-0435.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2024-0435
Aliases
Published
2024-12-19T12:00:00Z
Modified
2025-10-28T06:29:25.103174Z
Summary
Unsound usages of `Vec::from_raw_parts`
Details

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

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / fyrox-core

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.36.0

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "arch": [],
        "functions": [
            "fyrox_core::transmute_vec_as_bytes"
        ],
        "os": []
    }
}

Database specific

categories
[]
informational
"unsound"
cvss
null
source
"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2024-0435.json"