Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. zerovec-derive
  4. ›
  5. GHSA-74r5-g7vc-j2v2

GHSA-74r5-g7vc-j2v2: zerovec-derive incorrectly uses `#[repr(packed)]`

July 8, 2024 (updated July 9, 2024)

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.

References

  • github.com/advisories/GHSA-74r5-g7vc-j2v2
  • github.com/rustsec/advisory-db/pull/2007
  • github.com/unicode-org/icu4x/issues/5196
  • rustsec.org/advisories/RUSTSEC-2024-0346.html

Code Behaviors & Features

Detect and mitigate GHSA-74r5-g7vc-j2v2 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.9.7, all versions starting from 0.10.0 before 0.10.3

Fixed versions

  • 0.10.3
  • 0.9.7

Solution

Upgrade to versions 0.10.3, 0.9.7 or above.

Impact 6.2 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

Source file

cargo/zerovec-derive/GHSA-74r5-g7vc-j2v2.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:28 +0000.