{"id":"CVE-2021-28033","aliases":["EUVD-2021-1637","GHSA-8fgg-5v78-6g76","RUSTSEC-2021-0032"],"status":"published","title":"Deserializing an array can free uninitialized memory in byte_struct","description":"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.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-09","score":0.01295,"percentile":0.70535,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-119","CWE-908"],"published":"2021-03-01T12:00:00Z","modified":"2026-06-17T03:45:45Z","fixes":[{"ecosystem":"crates.io","package":"byte_struct","fixed_in":["0.6.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"byte_struct","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.6.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"byte_struct","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.6.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"byte_struct","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.6.1"}]}]}],"products":[{"vendor":"byte_struct_project","product":"byte_struct"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0032.html","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","web","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28033","tags":["advisory"]},{"url":"https://github.com/wwylele/byte-struct-rs/issues/1","tags":["web","report"]},{"url":"https://github.com/wwylele/byte-struct-rs/commit/a535678377de12bc6bc22620c5f59bcc1369f76f","tags":["web"]},{"url":"https://github.com/advisories/GHSA-8fgg-5v78-6g76"},{"url":"https://github.com/wwylele/byte-struct-rs","tags":["package"]},{"url":"https://crates.io/crates/byte_struct","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-28033","description":"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.","status":"published","published":"2021-03-05T08:38:21Z","modified":"2024-08-03T21:33:17.141Z","updated_at":"2026-11-02T14:33:09.175141Z"}],"euvd":[{"id":"EUVD-2021-1637","description":"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.","status":"published","published":"2021-03-05T08:38:21Z","modified":"2024-08-03T21:33:17Z","updated_at":"2026-11-03T03:24:47.80549Z"}],"ghsa":[{"id":"GHSA-8fgg-5v78-6g76","title":"Deserializing an array can free uninitialized memory in byte_struct","description":"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.","status":"published","published":"2021-08-25T20:52:03Z","modified":"2023-03-31T00:05:04Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-119","CWE-908"],"updated_at":"2026-11-02T14:36:48.905887Z"}],"nvd":[{"id":"CVE-2021-28033","description":"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.","status":"published","published":"2021-03-05T09:15:14.16Z","modified":"2026-06-17T03:45:45.16Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"cwes":["CWE-908"],"updated_at":"2026-11-02T14:06:50.399901Z"}],"osv":[{"id":"GHSA-8fgg-5v78-6g76","title":"Deserializing an array can free uninitialized memory in byte_struct","description":"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.","status":"published","published":"2021-08-25T20:52:03Z","modified":"2023-11-08T04:05:27.850049Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-119","CWE-908"],"updated_at":"2026-11-02T15:46:42.437513Z"},{"id":"RUSTSEC-2021-0032","title":"Deserializing an array can drop uninitialized memory on panic","description":"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.","status":"published","published":"2021-03-01T12:00:00Z","modified":"2023-11-08T04:05:27.850049Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:53:39.492624Z"}]}}
