Vulnerability DatabaseRUSTSEC-2021-0012

RUSTSEC-2021-0012
Rust vulnerability analysis and mitigation

Overview

The vulnerability (RUSTSEC-2021-0012) was discovered in the cdr-rs Rust crate, specifically in the Deserializer::read_vec method. The issue was identified and reported on January 2, 2021, by the Rust research group at Georgia Tech (sslab-gatech). The vulnerability affects the memory safety and soundness of applications using this crate (GitHub Issue).

Technical details

The vulnerability exists in the Deserializer::read_vec method within the cdr-rs/src/de.rs file. The method creates an uninitialized buffer and passes it to a user-provided Read implementation through the read_exact function. This implementation is unsound as it allows safe Rust code to trigger undefined behavior by reading from uninitialized memory (GitHub Issue).

Impact

The vulnerability could lead to undefined behavior in Rust applications using the cdr-rs crate, potentially compromising memory safety guarantees that Rust typically provides (GitHub Issue).

Exploitability

The vulnerability can be triggered when using the Deserializer::read_vec method with a user-provided Read implementation, potentially exposing applications to memory-related security issues (GitHub Issue).

Mitigation and workarounds

The recommended fix is to zero-initialize the newly allocated part of the u8 buffer before the read operation. This prevents user-provided Read implementations from accessing old contents from the newly allocated heap memory (GitHub Issue).

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

GHSA-5x78-73v4-xg6wHIGH8.7
  • Rust logoRust
  • postgres-protocol
NoYesAug 24, 2026
GHSA-fx4f-mhw4-qm7jMEDIUM6.9
  • Rust logoRust
  • vibeio-http
NoYesAug 24, 2026
GHSA-3gjw-f78c-vvpwMEDIUM6.9
  • Rust logoRust
  • tokio-postgres
NoYesAug 24, 2026
GHSA-rgqc-3x5p-6gwgMEDIUM6.9
  • Rust logoRust
  • postgres-protocol
NoYesAug 24, 2026
RUSTSEC-2026-0267NONEN/A
  • Rust logoRust
  • stable-vec
NoYesAug 24, 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