{"id":"RUSTSEC-2026-0274","aliases":["RUSTSEC-2026-0274"],"related":[],"kind":"vulnerability","state":"published","title":"Double free / use-after-free in `ReadChunk::commit` when an element's `Drop` panics","summary":"`ReadChunk::commit` and `ReadChunk::commit_all` drop the committed elements\nbefore advancing the consumer head. If an element's `Drop` panics during the\ndrop loop, `head` is never advanced, so the ring buffer still treats those slots\nas holding live elements. When the `RingBuffer` is later dropped (it walks\n`head..tail` and drops each slot), or a subsequent `read_chunk()` / `commit()`\ntouches the same slots, the already-dropped elements are dropped a second time —\na double free (CWE-415) / use-after-free (CWE-416) reachable from safe Rust.\n\n## Mitigation\n\nUpdate to 0.3.5 (0.3.x line) or 0.4.0. Note that 0.4.0 contains a behavior\nchange in `is_abandoned()`, so users on 0.3.x should prefer 0.3.5.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"`ReadChunk::commit` and `ReadChunk::commit_all` drop the committed elements\nbefore advancing the consumer head. If an element's `Drop` panics during the\ndrop loop, `head` is never advanced, so the ring buffer still treats those slots\nas holding live elements. When the `RingBuffer` is later dropped (it walks\n`head..tail` and drops each slot), or a subsequent `read_chunk()` / `commit()`\ntouches the same slots, the already-dropped elements are dropped a second time —\na double free (CWE-415) / use-after-free (CWE-416) reachable from safe Rust.\n\n## Mitigation\n\nUpdate to 0.3.5 (0.3.x line) or 0.4.0. Note that 0.4.0 contains a behavior\nchange in `is_abandoned()`, so users on 0.3.x should prefer 0.3.5.","format":"markdown","source":"rustsec"}],"published":"2026-08-04T12:00:00.000Z","modified":"2026-09-01T08:00:25.184Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.3.5"},{"type":"semver","introduced":"0.4.0-0","status":"affected","fixed":"0.4.0"}],"ecosystem":"crates.io","package":"rtrb","purl":"pkg:cargo/rtrb","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/rtrb","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0274.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/mgeier/rtrb/issues/185","tags":["report"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0274","url":"https://rustsec.org/advisories/RUSTSEC-2026-0274.html","licence":"CC0-1.0","modified":"2026-09-01T08:00:25.184Z"}],"updatedAt":"2026-11-25T22:56:43.404Z"}