{"id":"CVE-2021-26305","aliases":["CVE-2021-26305","GHSA-37jj-wp7g-7wj4","RUSTSEC-2021-0012"],"related":[],"kind":"vulnerability","state":"published","title":"Read of uninitialized memory in cdr","summary":"An issue was discovered in Deserializer::read_vec in the cdr crate before 0.2.4 for Rust. A user-provided Read implementation can gain access to the old contents of newly allocated heap memory, violating soundness.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in Deserializer::read_vec in the cdr crate before 0.2.4 for Rust. A user-provided Read implementation can gain access to the old contents of newly allocated heap memory, violating soundness.","source":"cvelist"},{"lang":"en","text":"`Deserializer::read_vec()` created an uninitialized buffer and passes it to a user-provided `Read` implementation (`Deserializer.reader.read_exact()`).\n\nPassing an uninitialized buffer to an arbitrary `Read` implementation is currently defined as undefined behavior in Rust. Official documentation for the `Read` trait explains the following: \"It is your responsibility to make sure that buf is initialized before calling read. Calling read with an uninitialized buf (of the kind one obtains via MaybeUninit<T>) is not safe, and can lead to undefined behavior.\"\n\nThe flaw was corrected in commit ce310f7 by zero-initializing the newly allocated buffer before handing it to `Deserializer.reader.read_exact()`.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la función Deserializer::read_vec en la crate cdr versiones anteriores a 0.2.4 para Rust.&#xa0;Una implementación de Lectura proporcionada por el usuario puede conseguir acceso a los contenidos antiguos de la memoria de pila recién asignada, violando la solidez","source":"nvd"}],"published":"2021-01-02T12:00:00.000Z","modified":"2026-06-17T03:43:04.767Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-908"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.2.4"}],"ecosystem":"crates.io","package":"cdr","purl":"pkg:cargo/cdr","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.2.4"}],"ecosystem":"crates.io","package":"cdr","purl":"pkg:cargo/cdr","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.2.4"}],"vendor":"cdr_project","product":"cdr","cpe":"cpe:2.3:a:cdr_project:cdr:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0012.html","tags":["advisory","exploit","vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26305","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/hrektts/cdr-rs/issues/10","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/hrektts/cdr-rs/pull/11","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/hrektts/cdr-rs/commit/0e6006de464caa331643f86cd2d9ba3b32b09833","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/hrektts/cdr-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/cdr","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-26305","url":"https://www.cve.org/CVERecord?id=CVE-2021-26305","licence":"CVE Terms of Use","modified":"2024-08-03T20:19:20.130Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-37jj-wp7g-7wj4","url":"https://github.com/advisories/GHSA-37jj-wp7g-7wj4","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:20.783Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0012","url":"https://rustsec.org/advisories/RUSTSEC-2021-0012.html","licence":"CC0-1.0","modified":"2023-11-08T04:05:20.783Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-26305","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26305","licence":"Public domain","modified":"2026-06-17T03:43:04.767Z"}],"updatedAt":"2026-11-25T22:57:59.752Z","epss":{"score":0.01662,"percentile":0.77394,"date":"2026-12-01T12:00:22.000Z"}}