Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. marc
  4. ›
  5. CVE-2021-26308

CVE-2021-26308: Uninitialized buffer use in marc

August 25, 2021 (updated June 13, 2023)

Affected versions of this crate passes an uninitialized buffer to a user-provided Read implementation. (Record::read()). Arbitrary Read implementations can read from the uninitialized buffer (memory exposure) and also can return incorrect number of bytes written to the buffer. Reading from uninitialized memory produces undefined values that can quickly invoke undefined behavior. This flaw was fixed in commit 6299af0 by zero-initializing the newly allocated memory (via data.resize(len, 0)) instead of exposing uninitialized memory (unsafe { data.set_len(len) }).

References

  • github.com/advisories/GHSA-3mf3-2gv9-h39j
  • github.com/blackbeam/rust-marc
  • github.com/blackbeam/rust-marc/commit/6299af0
  • github.com/blackbeam/rust-marc/issues/7
  • nvd.nist.gov/vuln/detail/CVE-2021-26308
  • rustsec.org/advisories/RUSTSEC-2021-0014.html

Code Behaviors & Features

Detect and mitigate CVE-2021-26308 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 2.0.0

Fixed versions

  • 2.0.0

Solution

Upgrade to version 2.0.0 or above.

Impact 7.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-908: Use of Uninitialized Resource

Source file

cargo/marc/CVE-2021-26308.yml

Spotted a mistake? Edit the file on GitLab.

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

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