Vulnerability DatabaseRUSTSEC-2021-0032

RUSTSEC-2021-0032
Rust vulnerability analysis and mitigation

Overview

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).

Technical details

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).

Impact

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).

Exploitability

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).

Mitigation and workarounds

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).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-24890MEDIUM6.8
  • Rust logoRust
  • igvm
NoYesSep 14, 2026
CVE-2026-55093MEDIUM6.1
  • Rust logoRust
  • tract-nnef
NoYesSep 14, 2026
CVE-2026-55832MEDIUM6.1
  • Rust logoRust
  • tract-onnx
NoYesSep 14, 2026
CVE-2026-54542LOW3.7
  • Rust logoRust
  • nimiq-primitives
NoYesSep 14, 2026
CVE-2026-54541LOW3.7
  • Rust logoRust
  • nimiq-primitives
NoYesSep 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management