Skip to content

zerovec-derive incorrectly uses `#[repr(packed)]`

Moderate severity GitHub Reviewed Published Jul 8, 2024 to the GitHub Advisory Database • Updated Jul 9, 2024

Package

zerovec-derive (Rust)

Affected versions

< 0.9.7
>= 0.10.0, < 0.10.3

Patched versions

0.9.7
0.10.3

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 rust-lang/rust#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.

References

Published to the GitHub Advisory Database Jul 8, 2024
Reviewed Jul 8, 2024
Last updated Jul 9, 2024

Severity

Moderate
6.2
/ 10

CVSS base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Weaknesses

CVE ID

No known CVE

GHSA ID

GHSA-74r5-g7vc-j2v2

Source code

No known source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.