{"id":"CVE-2021-28033","aliases":["CVE-2021-28033","GHSA-8fgg-5v78-6g76","RUSTSEC-2021-0032"],"related":[],"kind":"vulnerability","state":"published","title":"Deserializing an array can free uninitialized memory in byte_struct","summary":"An issue was discovered in the byte_struct crate before 0.6.1 for Rust. There can be a drop of uninitialized memory if a certain deserialization method panics.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the byte_struct crate before 0.6.1 for Rust. There can be a drop of uninitialized memory if a certain deserialization method panics.","source":"cvelist"},{"lang":"en","text":"Byte_struct stack and unpack structure as raw bytes with packed or bit field layout. An issue was discovered in the byte_struct crate before 0.6.1 for Rust. There can be a drop of uninitialized memory if a certain deserialization method panics.","format":"markdown","source":"ghsa"},{"lang":"en","text":"The `read_bytes_default_le` function for `[T; n]` arrays, used to deserialize\narrays of `T` from bytes created a `[T; n]` array with `std::mem::uninitialized`\nand then called `T`'s deserialization method.\n\nIf `T`'s deserialization method panicked, the uninitialized memory could drop\ninvalid objects.\n\nThis flaw was corrected in `a535678` by removing the unsafe block and using\na `.map` function to deserialize each element of the array instead.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate byte_struct versiones anteriores a 0.6.1 para Rust.&#xa0;Puede haber una perdida de la memoria no inicializada si determinado método de deserialización entra en pánico","source":"nvd"}],"published":"2021-03-01T12:00:00.000Z","modified":"2026-06-17T03:45:45.160Z","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-119","CWE-908"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.6.1"}],"ecosystem":"crates.io","package":"byte_struct","purl":"pkg:cargo/byte_struct","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.6.1"}],"ecosystem":"crates.io","package":"byte_struct","purl":"pkg:cargo/byte_struct","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.6.1"}],"vendor":"byte_struct_project","product":"byte_struct","cpe":"cpe:2.3:a:byte_struct_project:byte_struct:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0032.html","tags":["advisory","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28033","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/wwylele/byte-struct-rs/issues/1","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/wwylele/byte-struct-rs/commit/a535678377de12bc6bc22620c5f59bcc1369f76f","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/wwylele/byte-struct-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/byte_struct","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-28033","url":"https://www.cve.org/CVERecord?id=CVE-2021-28033","licence":"CVE Terms of Use","modified":"2024-08-03T21:33:17.141Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8fgg-5v78-6g76","url":"https://github.com/advisories/GHSA-8fgg-5v78-6g76","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:27.850Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0032","url":"https://rustsec.org/advisories/RUSTSEC-2021-0032.html","licence":"CC0-1.0","modified":"2023-11-08T04:05:27.850Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-28033","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28033","licence":"Public domain","modified":"2026-06-17T03:45:45.160Z"}],"updatedAt":"2026-11-25T22:58:00.154Z","epss":{"score":0.01311,"percentile":0.70787,"date":"2026-11-30T12:00:22.000Z"}}