{"id":"GHSA-74r5-g7vc-j2v2","aliases":["RUSTSEC-2024-0346"],"status":"published","title":"zerovec-derive incorrectly uses `#[repr(packed)]`","description":"The affected versions make unsafe memory accesses under the assumption that `#[repr(packed)]` has a guaranteed field order. \n\nThe Rust specification does not guarantee this, and https://github.com/rust-lang/rust/pull/125360 (1.80.0-beta) starts \nreordering fields of `#[repr(packed)]` structs, leading to illegal memory accesses.\n\nThe patched versions `0.9.7` and `0.10.3` use `#[repr(C, packed)]`, which guarantees field order.","severity":{"version":"4.0","score":6.9,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","level":"medium","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-120"],"published":"2024-07-01T12:00:00Z","modified":"2026-09-10T03:50:16Z","fixes":[{"ecosystem":"crates.io","package":"zerovec-derive","fixed_in":["0.9.7","0.10.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"zerovec-derive","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.9.7"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"zerovec-derive","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.10.0"},{"fixed":"0.10.3"}]}]},{"source":"osv","ecosystem":"crates.io","package":"zerovec-derive","ranges":[{"type":"SEMVER","events":[{"introduced":"0.10.0"},{"fixed":"0.10.3"}]}]},{"source":"osv","ecosystem":"crates.io","package":"zerovec-derive","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.9.7"}]}]},{"source":"osv","ecosystem":"crates.io","package":"zerovec-derive","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.9.7"},{"introduced":"0.10.0"},{"fixed":"0.10.3"}]}]}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2024-0346.html","tags":["web","advisory"]},{"url":"https://github.com/unicode-org/icu4x/issues/5196#issuecomment-2214711069","tags":["web"]},{"url":"https://github.com/rustsec/advisory-db/pull/2007","tags":["web"]},{"url":"https://github.com/advisories/GHSA-74r5-g7vc-j2v2"},{"url":"https://crates.io/crates/zerovec-derive","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-74r5-g7vc-j2v2","title":"zerovec-derive incorrectly uses `#[repr(packed)]`","description":"The affected versions make unsafe memory accesses under the assumption that `#[repr(packed)]` has a guaranteed field order. \n\nThe Rust specification does not guarantee this, and https://github.com/rust-lang/rust/pull/125360 (1.80.0-beta) starts \nreordering fields of `#[repr(packed)]` structs, leading to illegal memory accesses.\n\nThe patched versions `0.9.7` and `0.10.3` use `#[repr(C, packed)]`, which guarantees field order.\n","status":"published","published":"2024-07-08T18:39:18Z","modified":"2024-08-08T05:06:32Z","cvss":[{"version":"4.0","score":6.9,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","level":"medium"},{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"cwes":["CWE-120"],"updated_at":"2026-11-02T14:37:58.427757Z"}],"osv":[{"id":"GHSA-74r5-g7vc-j2v2","title":"zerovec-derive incorrectly uses `#[repr(packed)]`","description":"The affected versions make unsafe memory accesses under the assumption that `#[repr(packed)]` has a guaranteed field order. \n\nThe Rust specification does not guarantee this, and https://github.com/rust-lang/rust/pull/125360 (1.80.0-beta) starts \nreordering fields of `#[repr(packed)]` structs, leading to illegal memory accesses.\n\nThe patched versions `0.9.7` and `0.10.3` use `#[repr(C, packed)]`, which guarantees field order.\n","status":"published","published":"2024-07-08T18:39:18Z","modified":"2026-09-10T03:50:16.410729912Z","cvss":[{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"},{"version":"4.0","score":6.9,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"cwes":["CWE-120"],"updated_at":"2026-11-02T15:46:40.657155Z"},{"id":"RUSTSEC-2024-0346","title":"Incorrect usage of `#[repr(packed)]`","description":"The affected versions make unsafe memory accesses under the assumption that `#[repr(packed)]` has a guaranteed field order. \n\nThe Rust specification does not guarantee this, and https://github.com/rust-lang/rust/pull/125360 (1.80.0-beta) starts \nreordering fields of `#[repr(packed)]` structs, leading to illegal memory accesses.\n\nThe patched versions `0.9.7` and `0.10.3` use `#[repr(C, packed)]`, which guarantees field order.","status":"published","published":"2024-07-01T12:00:00Z","modified":"2025-10-28T06:29:23.437379Z","updated_at":"2026-11-02T15:53:39.971022Z"}]}}
