{"id":"RUSTSEC-2026-0293","revision":"96ceb9c02fdf4399be90f1449b86960a","records":[{"revision":"96ceb9c02fdf4399be90f1449b86960a","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"RUSTSEC-2026-0293","aliases":[],"title":"Double free / use-after-free in `Consumer::skip` and `Consumer::clear` when an element's `Drop` panics","description":"`Consumer::skip()` and `Consumer::clear()` are not panic-safe. They drop the\nconsumed elements in place and only afterwards call `advance_read_index()` to move\nthe ring buffer's read index past them. If an element's `Drop` panics mid-loop,\n`advance_read_index()` is never reached, so the read index still points at the\nalready-dropped elements. When the ring buffer is later dropped, its destructor\nre-visits those slots and drops the same elements a second time — a double free\n(CWE-415) / use-after-free (CWE-416) reachable from safe Rust, confirmed under\nAddressSanitizer.\n\n`Consumer::clear()` delegates to `Consumer::skip(self.len())`, so both share the\nsame root cause and the same fix.\n\n## Mitigation\n\nUpdate to 0.5.2 or later (fixed in agerasev/ringbuf#60).","state":0,"publishedAt":"2026-09-21T12:00:00+00:00","modifiedAt":"2026-09-21T09:15:02.8956642+00:00","affected":[{"ecosystem":"crates.io","name":"ringbuf","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.0.0-0"},{"kind":"fixed","version":"0.5.2"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://crates.io/crates/ringbuf","https://rustsec.org/advisories/RUSTSEC-2026-0293.html","https://github.com/agerasev/ringbuf/pull/60"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0293","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2026-0293","identifiers":["RUSTSEC-2026-0293"]},"retained":false,"historicalAffected":[]}],"coverage":[]}