Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. zerovec
  4. ›
  5. GHSA-xrv3-jmcp-374j

GHSA-xrv3-jmcp-374j: zerovec incorrectly uses `#[repr(packed)]`

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

References

  • github.com/advisories/GHSA-xrv3-jmcp-374j
  • rustsec.org/advisories/RUSTSEC-2024-0347.html

Code Behaviors & Features

Detect and mitigate GHSA-xrv3-jmcp-374j with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

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

Fixed versions

  • 0.10.4
  • 0.9.7

Solution

Upgrade to versions 0.10.4, 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/GHSA-xrv3-jmcp-374j.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sun, 08 Nov 2026 00:16:23 +0000.