Vulnerability DatabaseRUSTSEC-2021-0047

RUSTSEC-2021-0047
Rust vulnerability analysis and mitigation

Overview

A double-free vulnerability (RUSTSEC-2021-0047) was discovered in the slice-deque crate through 2021-02-19 for Rust. The vulnerability was identified in the SliceDeque::drain_filter function, where a double drop can occur upon a panic in a predicate function. The issue was assigned CVE-2021-29938 and affects all versions of the slice-deque crate up to and including the 2021-02-19 release (NVD).

Technical details

The vulnerability stems from a panic safety issue in the DrainFilter implementation returned by the SliceDeque::drain_filter function. The core issue lies in the code incrementing self.idx before calling self.pred, which can potentially panic. This sequence can leave the SliceDeque in an inconsistent state, leading to a double-free condition. The vulnerability has been assigned a CVSS v3.1 base score of 7.5 (HIGH) with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (NVD).

Impact

When exploited, this vulnerability can result in memory corruption through a double-free condition. The issue occurs when the predicate function panics during execution, causing the same memory location to be freed twice. This can potentially lead to program crashes and undefined behavior (GitHub Issue).

Exploitability

The vulnerability can be triggered by causing a panic in the predicate function passed to drain_filter. A proof-of-concept demonstration shows that when the predicate panics during iteration, it leads to a double-drop of elements in the SliceDeque (GitHub Issue).

Mitigation and workarounds

Users should upgrade to a version of slice-deque released after February 19, 2021, which contains the fix for this vulnerability (NVD).

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-2026-68537HIGH7.5
  • Rust logoRust
  • fulgur
NoYesSep 17, 2026
CVE-2026-68523HIGH7.5
  • Rust logoRust
  • fulgur
NoYesSep 17, 2026
RUSTSEC-2026-0289NONEN/A
  • Rust logoRust
  • pqc_kyber
NoNoSep 17, 2026
RUSTSEC-2026-0287NONEN/A
  • Rust logoRust
  • cosmian_kyber
NoNoSep 17, 2026
RUSTSEC-2026-0286NONEN/A
  • Rust logoRust
  • cryptoki
NoYesSep 16, 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