{"id":"RUSTSEC-2026-0300","revision":"8c43a491f8c64cffbf9164fde7e22089","records":[{"revision":"8c43a491f8c64cffbf9164fde7e22089","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"RUSTSEC-2026-0300","aliases":["GHSA-x6j6-3ffp-qrfr"],"title":"Use-after-free in `clear` and `retain` when an element's `Drop` panics","description":"`SkipList::clear` drops the node chain and only then resets `tail` and `len`.\nThe drop runs each element's `Drop`, and `T` carries no bounds excluding a\npanicking one. If it unwinds, `tail` still points at the freed node while `len`\nstays non-zero.\n\n`back()`, `back_mut()`, `last_key_value()` and `last()` dereference `tail`\nthrough `unsafe`, so reading the container after the unwind is a use-after-free\n(CWE-416). `Drop for SkipList` calls `Box::from_raw` on `self.head`, which\n`clear` already destroyed, so dropping the container is a double free\n(CWE-415).\n\n`retain`, `retain_mut` and `dedup_by` reach the same state through\n`Node::filter_rebuild`, which frees nodes and runs a user predicate before the\ncaller commits `tail` and `len`. There the head links are left partially\nrewired, so traversal can also reach freed nodes.\n\n## Mitigation\n\nUpdate to 1.1.1.","state":0,"publishedAt":"2026-09-02T12:00:00+00:00","modifiedAt":"2026-09-22T07:45:03.8956299+00:00","affected":[{"ecosystem":"crates.io","name":"skiplist","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.0.0-0"},{"kind":"fixed","version":"1.1.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://crates.io/crates/skiplist","https://rustsec.org/advisories/RUSTSEC-2026-0300.html","https://github.com/JP-Ellis/rust-skiplist/pull/334"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0300","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2026-0300","identifiers":["RUSTSEC-2026-0300","GHSA-x6j6-3ffp-qrfr"]},"retained":false,"historicalAffected":[]}],"coverage":[]}