GHSA-xrv3-jmcp-374j: zerovec incorrectly uses `#[repr(packed)]`
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.
Published Jul 8, 2024 · Updated Aug 7, 2024
Affected packages
zerovec
- Ecosystem
- Rust (crates.io)
- Affected
- >= 0.10.0, < 0.10.4
- Fixed in
- 0.10.4
- Check
cargo tree -i zerovec
zerovec
- Ecosystem
- Rust (crates.io)
- Affected
- < 0.9.7
- Fixed in
- 0.9.7
- Check
cargo tree -i zerovec
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
