RUSTSEC-2024-0347

Source
https://rustsec.org/advisories/RUSTSEC-2024-0347
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2024-0347.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2024-0347
Published
2024-07-01T12:00:00Z
Modified
2024-07-08T14:45:30Z
Summary
Incorrect usage of `#[repr(packed)]`
Details

The affected versions make unsafe memory accesses under the assumption that #[repr(packed)] has a guaranteed field order.

The Rust specification does not guarantee this, and https://github.com/rust-lang/rust/pull/125360 (1.80.0-beta) starts reordering fields of #[repr(packed)] structs, leading to illegal memory accesses.

The patched versions 0.9.7 and 0.10.4 use #[repr(C, packed)], which guarantees field order.

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

Affected packages

crates.io / zerovec

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.9.7
Introduced
0.10.0
Fixed
0.10.4

Ecosystem specific

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

Database specific

{
    "cvss": null,
    "informational": null,
    "categories": [
        "memory-corruption"
    ]
}