Headline
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.
Skip to content
Navigation Menu
Actions
Automate any workflow
Packages
Host and manage packages
Security
Find and fix vulnerabilities
Codespaces
Instant dev environments
GitHub Copilot
Write better code with AI
Code review
Manage code changes
Issues
Plan and track work
Discussions
Collaborate outside of code
GitHub Sponsors
Fund open source developers
* The ReadME Project
GitHub community articles
Enterprise platform
AI-powered developer platform
- Pricing
Provide feedback
Saved searches****Use saved searches to filter your results more quickly
Sign up
- GitHub Advisory Database
- GitHub Reviewed
- GHSA-xrv3-jmcp-374j
zerovec incorrectly uses `#[repr(packed)]`
Moderate severity GitHub Reviewed Published Jul 8, 2024 to the GitHub Advisory Database • Updated Jul 8, 2024
Package
cargo zerovec (Rust)
Affected versions
>= 0.10.0, < 0.10.4
< 0.9.7
Patched versions
0.10.4
0.9.7
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 rust-lang/rust#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
- https://rustsec.org/advisories/RUSTSEC-2024-0347.html
Published to the GitHub Advisory Database
Jul 8, 2024