Email me

Rust advisories / oneringbuf

Vulnerability MediumRUSTSEC-2026-0152 · oneringbuf

RUSTSEC-2026-0152: Use-after-free

Short answerA security vulnerability in the oneringbuf crate: Use-after-free. GitHub rates it Medium. Fixed in 0.8.0: update to a fixed version.

Crateoneringbuf
TypeVulnerability (memory-corruption)
Affected versionsBefore 0.8.0.
Fixed in0.8.0
SeverityMedium (GitHub rating)
Published2026-05-27
Last changed2026-08-04
Also known asGHSA-q95x-7g78-rccv

What to do

  1. See which version you have: cargo tree -i oneringbuf (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p oneringbuf. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example oneringbuf = "0.8.0") 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

Affected versions of oneringbuf exposed the obsolete IntoRef::into_ref method through the public IntoRef trait. For heap-backed ring buffers, this method returned a DroppableRef handle.

DroppableRef stored an owning raw pointer created from Box::into_raw. Its Clone implementation copied this raw pointer without incrementing the internal alive_iters counter. Internally, this clone pattern appears to rely on a fixed number of handles being created to match the initial alive_iters value. However, exposing DroppableRef through the public IntoRef::TargetRef associated type allows safe external code to create additional clones beyond that fixed count, breaking the lifetime protocol. Drop later dereferenced the pointer and could free the backing allocation with Box::from_raw.

Safe code could call IntoRef::into_ref to obtain a DroppableRef and then clone it. Each clone pointed to the same allocation, but the internal alive_iters counter was not increased. As a result, one clone could free the allocation while another clone still existed. Dropping the remaining clone then accessed freed memory, causing a heap-use-after-free.

The issue was fixed in version 0.8.0 by removing the obsolete into_ref method.

Trigger

use oneringbuf::{IntoRef, LocalHeapRB};

fn main() {
    let rb = LocalHeapRB::<usize>::from(vec![1, 2, 3]);

    let r = <LocalHeapRB<usize> as IntoRef>::into_ref(rb);
    let r2 = r.clone();
    let r3 = r.clone();

    drop(r);
    drop(r2);
    drop(r3); // AddressSanitizer: heap-use-after-free
}

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.

Other advisories for oneringbuf

Full security history of oneringbuf

Up next

Same crateoneringbuf: security historyEvery advisory for this crate, and whether it is safe to use today.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