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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| marc (crates.io) | before 2.0.0, from 0.0.0-0 before 2.0.0 | GitHub Advisory Database, RustSec Advisory Database |
| marc_project marc | before 2.0.0 | NVD |
All scores
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| RustSec Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 5.0medium CVSS:2.0 | AV: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
| https://rustsec.org/advisories/RUSTSEC-2021-0014.html | advisory, exploit, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-26308 | advisory | |
| https://github.com/blackbeam/rust-marc/issues/7 | report, web | |
| https://github.com/blackbeam/rust-marc/commit/6299af0 | web | |
| https://github.com/blackbeam/rust-marc | package | |
| https://crates.io/crates/marc | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-26308 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3mf3-2gv9-h39j changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0014 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-26308 changed 2026-06-17 | Public domain |