Skip to content

Commit 8342a90

Browse files
1 parent 9172cd3 commit 8342a90

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-rvr2-r3pv-5m4p",
4+
"modified": "2026-01-27T00:59:05Z",
5+
"published": "2026-01-27T00:59:04Z",
6+
"aliases": [],
7+
"summary": "oneshot has potential Use After Free when used asynchronously",
8+
"details": "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`.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "crates.io",
19+
"name": "oneshot"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "0.1.12"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/faern/oneshot/issues/73"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/rustsec/advisory-db/pull/2600"
44+
},
45+
{
46+
"type": "WEB",
47+
"url": "https://github.com/faern/oneshot/commit/d1a1506010bc48962634807d0dcca682af4f50ba"
48+
},
49+
{
50+
"type": "PACKAGE",
51+
"url": "https://github.com/faern/oneshot"
52+
},
53+
{
54+
"type": "WEB",
55+
"url": "https://rustsec.org/advisories/RUSTSEC-2026-0005.html"
56+
}
57+
],
58+
"database_specific": {
59+
"cwe_ids": [
60+
"CWE-362",
61+
"CWE-416"
62+
],
63+
"severity": "HIGH",
64+
"github_reviewed": true,
65+
"github_reviewed_at": "2026-01-27T00:59:04Z",
66+
"nvd_published_at": null
67+
}
68+
}

0 commit comments

Comments
 (0)