Skip to content

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

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

Package

cargo zerovec (Rust)

Affected versions

>= 0.10.0, < 0.10.4
< 0.9.7

Patched versions

0.10.4
0.9.7

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

References

Published to the GitHub Advisory Database Jul 8, 2024
Reviewed Jul 8, 2024
Last updated Aug 7, 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-xrv3-jmcp-374j

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.