CVE-2026-6654: Draining Iterator Stale Slice From Raw Parts Uaf

`slice::from_raw_parts_mut` is called inside `Iterator::next()` with a struct field length (`self.$STALE_LEN`) that may no longer reflect the number of currently initialized elements. Once any element has been moved out of the backing buffer during iteration, the field value becomes stale — the resulting slice falsely asserts that every slot holds a valid, i

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Rust
greprules fetch cve-2026-6654-draining-iterator-stale-slice-from-raw-parts-uaf --engine opengrep

Description

`slice::from_raw_parts_mut` is called inside `Iterator::next()` with a struct field length (`self.$STALE_LEN`) that may no longer reflect the number of currently initialized elements. Once any element has been moved out of the backing buffer during iteration, the field value becomes stale — the resulting slice falsely asserts that every slot holds a valid, i