{"id":"RUSTSEC-2026-0005","revision":"f2ac69c1183843fcb23a03a57625c27e","records":[{"revision":"f2ac69c1183843fcb23a03a57625c27e","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"RUSTSEC-2026-0005","aliases":["GHSA-rvr2-r3pv-5m4p"],"title":"Potential use-after-free in `oneshot` when used asynchronously","description":"There is a race condition that can lead to a use-after-free if a `oneshot::Receiver` is polled but then dropped instead of polled to completion. This could happen if the receiver future was cancelled while receiving, for example by being wrapped in a timeout future or similar.\n\nWhen the `Receiver` is polled (`Future::poll`) it writes a waker to the channel and sets it to the `RECEIVING` state. If the `Receiver` was then dropped (instead of polled to completion), the `Drop` implementation on `Receiver` unconditionally swapped the channel state to `DISCONNECTED` and only after doing so it read back its waker from the heap allocation and dropped it. The problem is that the `DISCONNECTED` state could be observed by the `Sender`, which would lead to it deallocating the channel heap memory. If the `Sender` manage to free the channel before the `Receiver` managed to proceed to dropping the waker, then the `Receiver` would read from the freed channel memory (use-after-free).\n\nThe fix was submitted in https://github.com/faern/oneshot/pull/74 and published as part of `oneshot` version `0.1.12`.","state":0,"publishedAt":"2026-01-25T12:00:00+00:00","modifiedAt":"2026-01-27T06:11:17.438685+00:00","affected":[{"ecosystem":"crates.io","name":"oneshot","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.1.2-0"},{"kind":"fixed","version":"0.1.12"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://crates.io/crates/oneshot","https://rustsec.org/advisories/RUSTSEC-2026-0005.html","https://github.com/faern/oneshot/issues/73"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0005","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2026-0005","identifiers":["RUSTSEC-2026-0005","GHSA-rvr2-r3pv-5m4p"]},"retained":false,"historicalAffected":[]}],"coverage":[]}