Email me

Rust advisories / owned-alloc

VulnerabilityRUSTSEC-2026-0291 · owned-alloc

RUSTSEC-2026-0291: Double free in `OwnedAlloc::drop_in_place` when the contained value's `Drop` panics

Short answerA security vulnerability in the owned-alloc crate: Double free in `OwnedAlloc::drop_in_place` when the contained value's `Drop` panics. No severity score was published. No fixed version: replace the crate or remove the affected code path.

Crateowned-alloc
TypeVulnerability (memory-corruption)
Affected versionsEvery version.
Fixed innone
Severitynot scored
Published2026-09-09
Last changed2026-09-21
Also known asnone
Affected functionsowned_alloc::MaybeUninitAlloc::drop_in_place, owned_alloc::OwnedAlloc::drop_in_place

What to do

  1. Find who pulls it in: cargo tree -i owned-alloc.
  2. Avoid the affected API (owned_alloc::MaybeUninitAlloc::drop_in_place, owned_alloc::OwnedAlloc::drop_in_place), or replace the crate.

Details from the advisory

OwnedAlloc::drop_in_place destroys the contained value by hand, then commits the ownership transfer with mem::forget(self) , which lives inside into_raw and so runs only after the destruction. T::drop is user code and may panic. If it does, the forget is skipped and the still-live OwnedAlloc unwinds, whose destructor drops the same T a second time and then deallocates. For a T that owns an allocation, the same block is freed twice , a double free (CWE-415). That destructor also reads the already-destroyed value through Layout::for_value before deallocating, a use-after-free (CWE-416).

MaybeUninitAlloc::drop_in_place delegates to the same function, so both public entry points are affected. Storing a value whose Drop can panic and calling either is enough , no unsafe on the caller's side.

Fix

No fixed release is available. The crate has had no release since 2018 and the maintainer has not responded to the report, nor to the one on lockfree, which is published from the same account. forget_inner leaks the value instead of destroying it, which is safe.

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 owned-alloc

Full security history of owned-alloc

Up next

Same crateowned-alloc: 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