RUSTSEC-2026-0291

Source
https://rustsec.org/advisories/RUSTSEC-2026-0291
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0291.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2026-0291
Published
2026-09-09T12:00:00Z
Modified
2026-09-21T09:15:02Z
Summary
Double free in `OwnedAlloc::drop_in_place` when the contained value's `Drop` panics
Details

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.

Database specific
{
    "license":  "CC0-1.0"
}
References

Affected packages

crates.io / owned-alloc

Package

Name
owned-alloc
View open source insights on deps.dev
Purl
pkg:cargo/owned-alloc

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0

Ecosystem specific

{
    "affected_functions":  null,
    "affects":  {
        "arch":  [],
        "functions":  [
            "owned_alloc::MaybeUninitAlloc::drop_in_place",
            "owned_alloc::OwnedAlloc::drop_in_place"
        ],
        "os":  []
    }
}

Database specific

categories
[
    "memory-corruption"
]
cvss
null
informational
null
source
"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0291.json"