# GHSA-xrv3-jmcp-374j: zerovec 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:17.197Z
- Also known as: RUSTSEC-2024-0347
- 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.4` use `#[repr(C, packed)]`, which guarantees field order.

(As written by GitHub Advisory Database.)

## Affected

- zerovec (crates.io): from 0.10.0 before 0.10.4; 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://rustsec.org/advisories/RUSTSEC-2024-0347.html> (advisory, web)
- <https://crates.io/crates/zerovec> (package)

## Sources

- GitHub Advisory Database: [GHSA-xrv3-jmcp-374j](https://github.com/advisories/GHSA-xrv3-jmcp-374j), CC-BY-4.0, modified 2026-09-10
- RustSec Advisory Database: [RUSTSEC-2024-0347](https://rustsec.org/advisories/RUSTSEC-2024-0347.html), CC0-1.0, modified 2025-10-28

---

Page: https://cve.day/GHSA-xrv3-jmcp-374j · Whole record: https://cve.day/GHSA-xrv3-jmcp-374j.json · Rebuilt by cve.day 2026-11-25T22:56:43.197Z
