Advisory

GHSA-xrv3-jmcp-374j

Also known as: RUSTSEC-2024-0347

Summary

zerovec incorrectly uses #[repr(packed)]

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2024-07-08 18:36 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

zerovec

crates.io · All systems

Affected

  • introduced 0.10.0, fixed 0.10.4 (semver)

Fixed versions

0.10.4

Fix

  • Fixed version 0.10.4
    cargo update -p zerovec --precise 0.10.4

zerovec

crates.io · All systems

Affected

  • introduced 0, fixed 0.9.7 (semver)

Fixed versions

0.9.7

Fix

  • Fixed version 0.9.7
    cargo update -p zerovec --precise 0.9.7

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences