{"id":"CVE-2021-26308","aliases":["EUVD-2021-1549","GHSA-3mf3-2gv9-h39j","RUSTSEC-2021-0014"],"status":"published","title":"Uninitialized buffer use in marc","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.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-10","score":0.01516,"percentile":0.74749,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-908"],"published":"2021-01-26T12:00:00Z","modified":"2026-10-24T10:30:42Z","fixes":[{"ecosystem":"crates.io","package":"marc","fixed_in":["2.0.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"marc","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.0"}]}]},{"source":"osv","ecosystem":"crates.io","package":"marc","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.0.0"}]}]},{"source":"osv","ecosystem":"crates.io","package":"marc","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"2.0.0"}]}]}],"products":[{"vendor":"marc_project","product":"marc"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0014.html","tags":["x_refsource_MISC","x_transferred","Exploit","Vendor Advisory","evidence","web","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26308","tags":["advisory"]},{"url":"https://github.com/blackbeam/rust-marc/issues/7","tags":["web","report"]},{"url":"https://github.com/blackbeam/rust-marc/commit/6299af0","tags":["web"]},{"url":"https://github.com/advisories/GHSA-3mf3-2gv9-h39j"},{"url":"https://github.com/blackbeam/rust-marc","tags":["package"]},{"url":"https://crates.io/crates/marc","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-26308","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.","status":"published","published":"2021-01-29T02:27:00Z","modified":"2024-08-03T20:19:20.392Z","updated_at":"2026-11-02T14:32:57.368269Z"}],"euvd":[{"id":"EUVD-2021-1549","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.","status":"published","published":"2021-01-29T02:27:00Z","modified":"2024-08-03T20:19:20Z","updated_at":"2026-11-03T03:24:51.962182Z"}],"ghsa":[{"id":"GHSA-3mf3-2gv9-h39j","title":"Uninitialized buffer use in marc","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) }).","status":"published","published":"2021-08-25T20:53:14Z","modified":"2023-06-13T18:44:37Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"cwes":["CWE-908"],"updated_at":"2026-11-02T14:36:53.654352Z"}],"nvd":[{"id":"CVE-2021-26308","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.","status":"published","published":"2021-01-29T03:15:12.55Z","modified":"2026-06-17T03:43:05.123Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"primary"},{"version":"2.0","score":5,"vector":"AV:N/AC:L/Au:N/C:P/I:N/A:N","level":"medium","assessor":"primary"}],"updated_at":"2026-11-02T14:06:49.660551Z"}],"osv":[{"id":"CVE-2021-26308","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.","status":"published","published":"2021-01-29T03:15:12.55Z","modified":"2026-10-24T10:30:42.675687667Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"updated_at":"2026-11-02T15:44:18.778776Z"},{"id":"GHSA-3mf3-2gv9-h39j","title":"Uninitialized buffer use in marc","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) }).","status":"published","published":"2021-08-25T20:53:14Z","modified":"2023-11-08T04:05:20.909149Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"cwes":["CWE-908"],"updated_at":"2026-11-02T15:46:35.747385Z"},{"id":"RUSTSEC-2021-0014","title":"Record::read : Custom `Read` on uninitialized buffer may cause UB","description":"Affected versions of this crate passes an uninitialized buffer to a user-provided `Read` implementation. (`Record::read()`)\n\nArbitrary `Read` implementations can read from the uninitialized buffer (memory exposure) and also can return incorrect number of bytes written to the buffer.\nReading from uninitialized memory produces undefined values that can quickly invoke undefined behavior.\n\nThis 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) }`).","status":"published","published":"2021-01-26T12:00:00Z","modified":"2023-11-08T04:05:20.909149Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"updated_at":"2026-11-02T15:53:39.492624Z"}]}}
