CVE-2021-26308
JSON

7.5high

Uninitialized buffer use in marc

Severity
7.5high CVSS:3.1 by NVD
Exploit likelihood
1.52% (higher than 75% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-3mf3-2gv9-h39jRUSTSEC-2021-0014

Description

An issue was discovered in the marc crate before 2.0.0 for Rust. A user-provided Read implementation can gain access to the old contents of newly allocated memory, violating soundness.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
marc (crates.io)before 2.0.0, from 0.0.0-0 before 2.0.0GitHub Advisory Database, RustSec Advisory Database
marc_project marcbefore 2.0.0NVD

All scores

GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
RustSec Advisory Database7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:P/I:N/A:N

Classification

What each source says

CVE List

An issue was discovered in the marc crate before 2.0.0 for Rust. A user-provided Read implementation can gain access to the old contents of newly allocated memory, violating soundness.

GitHub Advisory Database

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

RustSec Advisory Database

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

NVD (es)

Se detectó un problema en la crate marc versiones anteriores a la 2.0.0 para Rust. Una implementación de Lectura proporcionada por el usuario puede conseguir acceso al contenido antiguo de la memoria recientemente asignada, violando la solidez

References

Sources

SourceRecordLicence
CVE ListCVE-2021-26308 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-3mf3-2gv9-h39j changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0014 changed 2023-11-08CC0-1.0
NVDCVE-2021-26308 changed 2026-06-17Public domain