Email me

Rust advisories / circular-buffer

UnsoundRUSTSEC-2026-0256 · circular-buffer

RUSTSEC-2026-0256: Panic-safety unsoundness in `truncate_back`, `truncate_front`, `clear`, and `extend_from_slice` (use-after-free / double-free)

Short answercircular-buffer has an API that can cause undefined behaviour from safe code: Panic-safety unsoundness in `truncate_back`, `truncate_front`, `clear`, and `extend_from_slice` (use-after-free / double-free). Fixed in 2.0.1.

Cratecircular-buffer
TypeUnsound (memory-corruption)
Affected versionsBefore 2.0.1.
Fixed in2.0.1
Severitynot scored
Published2026-08-11
Last changed2026-08-12
Also known asnone
Affected functionscircular_buffer::CircularBuffer::clear, circular_buffer::CircularBuffer::extend_from_slice, circular_buffer::CircularBuffer::truncate_back, circular_buffer::CircularBuffer::truncate_front

What to do

  1. See which version you have: cargo tree -i circular-buffer (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p circular-buffer. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example circular-buffer = "2.0.1") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

Several methods in circular-buffer drop elements before updating the buffer's start/end metadata. If an element's Drop panics during the drop, the metadata update is skipped, so the buffer still treats the already-dropped elements as live. When the buffer is later dropped (or used after the panic is caught), those elements are visited again , a use-after-free / double-free reachable from safe Rust.

Impact

  • **CWE-415 (Double Free):** the same allocation is freed twice.
  • **CWE-416 (Use-After-Free):** a freed allocation is accessed during a repeated Drop.

Reachable entirely from safe Rust via catch_unwind with element types whose Drop can panic.

Fix

Fixed in circular-buffer 2.0.1 by adjusting the buffer's start/end metadata before the elements are dropped.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ