GHSA-xrv3-jmcp-374j zerovec incorrectly uses `#[repr(packed)]`
MediumCVSS 6.9
- Published
- Updated
- Exploit status
- No public exploit known
Description
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.
Upgrade path
1 package: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| crates.io zerovec(crates.io) | < 0.9.7; >= 0.0.0-0, < 0.9.7; >= 0.10.0, < 0.10.4 | 0.9.7, 0.10.4 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| crates.io zerovec(crates.io) | >= 0.10.0, < 0.10.4 | 0.10.4 |
| crates.io zerovec(crates.io) | < 0.9.7 | 0.9.7 |
| crates.io zerovec(crates.io) | >= 0.0.0-0, < 0.9.7 | 0.9.7 |
References
- rustsec.org vendor-advisory
- crates.io product
- github.com