logo

GHSA-74r5-g7vc-j2v2 zerovec-derive

Package

Manager: cargo
Name: zerovec-derive
Vulnerable Version: >=0.10.0 <0.10.3 || >=0 <0.9.7

Severity

Level: Medium

CVSS v3.1: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

CVSS v4.0: 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

EPSS: N/A pctlN/A

Details

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

Metadata

Created: 2024-07-08T18:39:18Z
Modified: 2024-07-09T19:45:09Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/07/GHSA-74r5-g7vc-j2v2/GHSA-74r5-g7vc-j2v2.json
CWE IDs: ["CWE-120"]
Alternative ID: N/A
Finding: F316
Auto approve: 1