{"id":"GHSA-xrv3-jmcp-374j","aliases":["RUSTSEC-2024-0347"],"status":"published","title":"zerovec 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.4` 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:17Z","fixes":[{"ecosystem":"crates.io","package":"zerovec","fixed_in":["0.10.4","0.9.7"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"zerovec","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.10.0"},{"fixed":"0.10.4"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"zerovec","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.9.7"}]}]},{"source":"osv","ecosystem":"crates.io","package":"zerovec","ranges":[{"type":"SEMVER","events":[{"introduced":"0.10.0"},{"fixed":"0.10.4"}]}]},{"source":"osv","ecosystem":"crates.io","package":"zerovec","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.9.7"}]}]},{"source":"osv","ecosystem":"crates.io","package":"zerovec","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.9.7"},{"introduced":"0.10.0"},{"fixed":"0.10.4"}]}]}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2024-0347.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-xrv3-jmcp-374j"},{"url":"https://crates.io/crates/zerovec","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-xrv3-jmcp-374j","title":"zerovec 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.4` use `#[repr(C, packed)]`, which guarantees field order.\n","status":"published","published":"2024-07-08T18:36:40Z","modified":"2024-08-07T05:01:39Z","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-xrv3-jmcp-374j","title":"zerovec 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.4` use `#[repr(C, packed)]`, which guarantees field order.\n","status":"published","published":"2024-07-08T18:36:40Z","modified":"2026-09-10T03:50:17.197493907Z","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:47:00.198893Z"},{"id":"RUSTSEC-2024-0347","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.4` use `#[repr(C, packed)]`, which guarantees field order.","status":"published","published":"2024-07-01T12:00:00Z","modified":"2025-10-28T06:29:27.173105Z","updated_at":"2026-11-02T15:53:39.971022Z"}]}}
