Every CVE Search/ Get API key

CVE-2021-28033

Deserializing an array can free uninitialized memory in byte_struct

9.8 CriticalFix available

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

1.29%Up 0.9 points since Apr 14, 2021
90%50%10%1%

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 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
7.5 HighAV: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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

Affected packages
PackageAffectedFixed
byte_struct
crates.io
before 0.6.1
0.6.1
byte_struct
crates.io
0.0.0-0 up to 0.6.1
0.6.1

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE 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

MoveEnter Open