GitHub Advisoryadvisory · crates.io

GHSA-3mf3-2gv9-h39j Uninitialized buffer use in marc

HIGH Published 2021-08-25 Modified 2023-06-13 Official page ↗
Aliases
CVE-2021-26308
Ecosystem
crates.io
Packages
marc
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weaknesses
CWE-908
Reviewed
2021-08-19

Affected packages

• crates.io marc: < 2.0.0 → fixed in 2.0.0

Description

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) }).

Related

Alias · CVE (1)

  • CVE-2021-26308 An issue was discovered in the marc crate before 2.0.0 for Rust. vulnerability

Weakness · CWE (1)

  • CWE-908 Use of Uninitialized Resource weakness

References