oneshot has potential Use After Free when used asynchronously
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
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. When 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). The fix was submitted in https://github.com/faern/oneshot/pull/74 and published as part of `oneshot` version `0.1.12`.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | oneshot (crates.io) | before 0.1.12 | 0.1.12 | Patch available | GHSA-rvr2-r3pv-5m4p |
- oneshot (crates.io) Vendor— Affected before 0.1.12 Fixed in 0.1.12 Patch available GHSA-rvr2-r3pv-5m4p
Remediation
- Fix · GHSA-rvr2-r3pv-5m4p oneshot (crates.io) Fixed in 0.1.12 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-rvr2-r3pv-5m4p
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences