# GHSA-74r5-g7vc-j2v2: zerovec-derive incorrectly uses `#[repr(packed)]`

- Severity: Medium (CVSS:4.0, scored by GitHub) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2024-07-01T12:00:00.000Z
- Modified: 2026-09-10T03:50:16.410Z
- Also known as: RUSTSEC-2024-0346
- Weaknesses: CWE-120

## 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.3` use `#[repr(C, packed)]`, which guarantees field order.

(As written by GitHub Advisory Database.)

## Affected

- zerovec-derive (crates.io): from 0.10.0 before 0.10.3; before 0.9.7; from 0.0.0-0 before 0.9.7

## Every score

- GitHub: CVSS:3.1 6.2 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:4.0 Medium `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`

## References

- <https://github.com/unicode-org/icu4x/issues/5196#issuecomment-2214711069> (web)
- <https://github.com/rustsec/advisory-db/pull/2007> (web)
- <https://rustsec.org/advisories/RUSTSEC-2024-0346.html> (advisory, web)
- <https://crates.io/crates/zerovec-derive> (package)

## Sources

- GitHub Advisory Database: [GHSA-74r5-g7vc-j2v2](https://github.com/advisories/GHSA-74r5-g7vc-j2v2), CC-BY-4.0, modified 2026-09-10
- RustSec Advisory Database: [RUSTSEC-2024-0346](https://rustsec.org/advisories/RUSTSEC-2024-0346.html), CC0-1.0, modified 2025-10-28

---

Page: https://cve.day/GHSA-74r5-g7vc-j2v2 · Whole record: https://cve.day/GHSA-74r5-g7vc-j2v2.json · Rebuilt by cve.day 2026-11-25T22:56:43.197Z
