RUSTSEC-2024-0346

Source
https://rustsec.org/advisories/RUSTSEC-2024-0346
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2024-0346.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2024-0346
Published
2024-07-01T12:00:00Z
Modified
2024-07-08T17:05:42Z
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.3 use #[repr(C, packed)], which guarantees field order.

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

Affected packages

crates.io / zerovec-derive

Package

Name
zerovec-derive
View open source insights on deps.dev
Purl
pkg:cargo/zerovec-derive

Affected ranges

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

Ecosystem specific

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

Database specific

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