{"id":"RUSTSEC-2026-0284","revision":"1d8f37fb0f6a42b2bc68c61ccb79ffa0","records":[{"revision":"1d8f37fb0f6a42b2bc68c61ccb79ffa0","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"RUSTSEC-2026-0284","aliases":[],"title":"Double free in `Map::into_iter` and an uninitialized `Arc` in `SharedIncin::clear`","description":"Two independent soundness problems, both reachable from safe Rust.\n\n`Map::into_iter` drops `builder` (the caller-supplied hasher `H`) and `incin` by\nhand, then commits the ownership transfer with `mem::forget(self)`. `H::drop` is\nuser code and may panic. If it does, `mem::forget(self)` is skipped and the\nstill-live `Map` unwinds, whose field drop glue destroys `builder` a second\ntime. An empty map is enough — no entries or concurrency required.\n\n`SharedIncin::clear` writes `mem::uninitialized::<Arc<_>>()` into `self.inner`\nbefore taking the real `Arc` out. `Arc` has a validity invariant, so this is\nundefined behaviour at the point of creation, with no panic or concurrency\ninvolved. Between that write and the repairing one, `self.inner` also holds\ngarbage while `self` is still droppable, so an unwind from `incin.clear()` or\n`Arc::new` decrements a refcount through an uninitialized pointer. The\n`make_shared_incin!` macro is instantiated five times, so this covers `queue`,\n`stack`, `map`, `channel::spmc` and `channel::mpmc`.\n\n## Impact\n\n* CWE-415 (Double Free): the same allocation is freed twice.\n* CWE-416 (Use-After-Free): a freed allocation is accessed during a repeated `Drop`.\n* CWE-908 (Use of Uninitialized Resource): an `Arc` is constructed from uninitialized bytes.\n\n## Fix\n\nNo fixed release is available. The crate has had no release since 2018-11-18 and\nthe maintainer has not responded to the report.","state":0,"publishedAt":"2026-08-26T12:00:00+00:00","modifiedAt":"2026-09-14T10:00:03.0176658+00:00","affected":[{"ecosystem":"crates.io","name":"lockfree","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.0.0-0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://crates.io/crates/lockfree","https://rustsec.org/advisories/RUSTSEC-2026-0284.html","https://gitlab.com/bzim/lockfree/-/issues/7"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0284","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2026-0284","identifiers":["RUSTSEC-2026-0284"]},"retained":false,"historicalAffected":[]}],"coverage":[]}