Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. oneshot
  4. ›
  5. GHSA-rvr2-r3pv-5m4p

GHSA-rvr2-r3pv-5m4p: oneshot has potential Use After Free when used asynchronously

January 27, 2026

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.

References

  • github.com/advisories/GHSA-rvr2-r3pv-5m4p
  • github.com/faern/oneshot
  • github.com/faern/oneshot/commit/d1a1506010bc48962634807d0dcca682af4f50ba
  • github.com/faern/oneshot/issues/73
  • github.com/rustsec/advisory-db/pull/2600
  • rustsec.org/advisories/RUSTSEC-2026-0005.html

Code Behaviors & Features

Detect and mitigate GHSA-rvr2-r3pv-5m4p with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.1.12

Fixed versions

  • 0.1.12

Solution

Upgrade to version 0.1.12 or above.

Impact 5.9 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
  • CWE-416: Use After Free

Source file

cargo/oneshot/GHSA-rvr2-r3pv-5m4p.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 04 Feb 2026 00:35:54 +0000.