
Cloud Vulnerability DB
A community-led vulnerabilities database
The byte_struct crate for Rust (versions before 0.6.1) was discovered to have a vulnerability identified as RUSTSEC-2021-0032. The issue involves potential dropping of uninitialized memory during certain deserialization operations when a panic occurs (RustSec Advisory).
The vulnerability stems from the implementation of the read_bytes_default_le method for array types. The code creates uninitialized memory using std::mem::uninitialized() to hold unpacked type T, and then calls read_bytes_default_le, which could potentially panic when handling custom types. If a panic occurs, the uninitialized memory would be incorrectly dropped as if it were a valid instance of type T. The vulnerability has been assigned a CVSS v3.1 base score of 9.8 (CRITICAL) with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. The issue is classified under CWE-908 (Use of Uninitialized Resource) (NVD).
When exploited, this vulnerability can lead to the dropping of uninitialized memory, potentially causing memory corruption or undefined behavior in Rust applications using the affected versions of the byte_struct crate. This is particularly concerning as it breaks Rust's memory safety guarantees (GitHub Issue).
The vulnerability can be triggered when deserializing custom types that implement panic behavior during the read_bytes operation. A proof of concept demonstrating the issue was provided, showing how uninitialized memory values are incorrectly dropped when a panic occurs during deserialization (GitHub Issue).
The vulnerability has been fixed in version 0.6.1 of the byte_struct crate. Users are advised to update to this version or later. The recommended fix involves using MaybeUninit instead of std::mem::uninitialized() to properly handle potentially uninitialized memory (RustSec Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."