Rust advisories / marc
Vulnerability HighRUSTSEC-2021-0014 · marc
RUSTSEC-2021-0014: Record::read : Custom `Read` on uninitialized buffer may cause UB
Short answerA security vulnerability in the marc crate: Record::read : Custom `Read` on uninitialized buffer may cause UB. High severity (CVSS 7.5). Fixed in 2.0.0: update to a fixed version.
| Crate | marc |
|---|---|
| Type | Vulnerability (memory-exposure) |
| Affected versions | Before 2.0.0. |
| Fixed in | 2.0.0 |
| Severity | High, CVSS 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| Published | 2021-01-26 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-26308, GHSA-3mf3-2gv9-h39j |
What to do
- See which version you have:
cargo tree -i marc(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p marc. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplemarc = "2.0.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
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
- Package: crates.io/crates/marc
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0014.html
- Report: github.com/blackbeam/rust-marc/issues/7
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?