Vulnerability HighRUSTSEC-2021-0047 · slice-deque
RUSTSEC-2021-0047: SliceDeque::drain_filter can double drop an element if the predicate panics
Short answerA security vulnerability in the slice-deque crate: SliceDeque::drain_filter can double drop an element if the predicate panics. High severity (CVSS 7.5). No fixed version: replace the crate or remove the affected code path.
| Crate | slice-deque |
|---|---|
| Type | Vulnerability (memory-corruption) |
| Affected versions | Every version. |
| Fixed in | none |
| Severity | High, CVSS 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| Published | 2021-02-19 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-29938, GHSA-p9gf-gmfv-398m |
What to do
- Find who pulls it in:
cargo tree -i slice-deque. - Avoid the affected API, or replace the crate.
Details from the advisory
Affected versions of the crate incremented the current index of the drain filter iterator *before* calling the predicate function self.pred.
If the predicate function panics, it is possible for the last element in the iterator to be dropped twice.
References
- Package: crates.io/crates/slice-deque
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0047.html
- Report: github.com/gnzlbg/slice_deque/issues/90
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for slice-deque
- Vulnerability CriticalRUSTSEC-2018-0008 · 2018-12-05Bug in SliceDeque::move_head_unchecked allows read of corrupted memory
- Vulnerability CriticalRUSTSEC-2019-0002 · 2019-05-07Bug in SliceDeque::move_head_unchecked corrupts its memory
- UnmaintainedRUSTSEC-2020-0158 · 2020-02-10slice-deque is unmaintained
Up next
Same crateslice-deque: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?