CVE-2021-28033
Deserializing an array can free uninitialized memory in byte_struct
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
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.
- Record
CVE-2021-28033- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-908
- Updated
- 2026-11-02
CVE List No score
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.
- Record
CVE-2021-28033- Updated
- 2026-11-02
EUVDEUVD-2021-1637 No score
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.
- Record
EUVD-2021-1637- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-8fgg-5v78-6g76
9.8
Deserializing an array can free uninitialized memory in byte_struct
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.
- Record
GHSA-8fgg-5v78-6g76- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-119, CWE-908
- Updated
- 2026-11-02
OSVGHSA-8fgg-5v78-6g76
9.8
Deserializing an array can free uninitialized memory in byte_struct
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.
- Record
GHSA-8fgg-5v78-6g76- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-119, CWE-908
- Updated
- 2026-11-02
OSVRUSTSEC-2021-0032
9.8
Deserializing an array can drop uninitialized memory on panic
The read_bytes_default_le function for [T; n] arrays, used to deserialize
arrays of T from bytes created a [T; n] array with std::mem::uninitialized
and then called T's deserialization method.
If T's deserialization method panicked, the uninitialized memory could drop
invalid objects.
This flaw was corrected in a535678 by removing the unsafe block and using
a .map function to deserialize each element of the array instead.
- Record
RUSTSEC-2021-0032- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
byte_structcrates.io |
before 0.6.1 | 0.6.1 |
byte_structcrates.io |
0.0.0-0 up to 0.6.1 | 0.6.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-28033 is a critical vulnerability (CVSS 9.8) in Byte Struct Project Struct, published March 1, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.29%, the 70th percentile. Fixed in byte_struct 0.6.1.
References
rustsec.org/advisories/RUSTSEC-2021-0032.html
nvd.nist.gov/vuln/detail/CVE-2021-28033
github.com/wwylele/byte-struct-rs/issues/1
github.com/wwylele/byte-struct-rs/commit/a535678377de12bc6bc22620c5f59bcc1369f76f
github.com/advisories/GHSA-8fgg-5v78-6g76
github.com/wwylele/byte-struct-rs
crates.io/crates/byte_struct