GHSA-74r5-g7vc-j2v2 json
zerovec-derive incorrectly uses `#[repr(packed)]`
published 2y ago modified 2mo ago also RUSTSEC-2024-0346
- cvss
- 6.2
- version 3.1, GitHub
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- —
- no score, EPSS covers CVEs only
- public exploits
- 0
- none known
Summary
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.3` use `#[repr(C, packed)]`, which guarantees field order.
Patch / fix
- crates.io zerovec-derive 0.9.7, 0.10.3
Is GHSA-74r5-g7vc-j2v2 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| GitHub | 3.1 | 6.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | zerovec-derive | >=0.10.0, <0.10.3 <0.9.7 >=0.0.0-0, <0.9.7 |
0.10.3 0.9.7 |
Classification
- Weakness
-
- CWE-120 Buffer Copy without Checking Size of Input
References
Sources
- GitHub Advisory GHSA-74r5-g7vc-j2v2
- OSV RUSTSEC-2024-0346
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.