CVE-2021-38191
Race condition in tokio
An issue was discovered in the tokio crate before 1.8.1 for Rust. Upon a JoinHandle::abort, a Task may be dropped in the wrong thread.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
5.9
An issue was discovered in the tokio crate before 1.8.1 for Rust. Upon a JoinHandle::abort, a Task may be dropped in the wrong thread.
- Record
CVE-2021-38191- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 4.3 Medium
AV:N/AC:M/Au:N/C:N/I:N/A:P - Weakness
- CWE-362
- Updated
- 2026-11-02
CVE List No score
An issue was discovered in the tokio crate before 1.8.1 for Rust. Upon a JoinHandle::abort, a Task may be dropped in the wrong thread.
- Record
CVE-2021-38191- Updated
- 2026-11-02
EUVDEUVD-2021-1512 No score
An issue was discovered in the tokio crate before 1.8.1 for Rust. Upon a JoinHandle::abort, a Task may be dropped in the wrong thread.
- Record
EUVD-2021-1512- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-2grh-hm3w-w7hv
5.9
Race condition in tokio
When aborting a task with JoinHandle::abort, the future is dropped in the thread calling abort if the task is not currently being executed. This is incorrect for tasks spawned on a LocalSet. This can easily result in race conditions as many projects use Rc or RefCell in their Tokio tasks for better performance.
- Record
GHSA-2grh-hm3w-w7hv- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-362, CWE-366
- Updated
- 2026-11-02
OSV
5.9
An issue was discovered in the tokio crate before 1.8.1 for Rust. Upon a JoinHandle::abort, a Task may be dropped in the wrong thread.
- Record
CVE-2021-38191- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVGHSA-2grh-hm3w-w7hv
5.9
Race condition in tokio
When aborting a task with JoinHandle::abort, the future is dropped in the thread calling abort if the task is not currently being executed. This is incorrect for tasks spawned on a LocalSet. This can easily result in race conditions as many projects use Rc or RefCell in their Tokio tasks for better performance.
- Record
GHSA-2grh-hm3w-w7hv- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-362, CWE-366
- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:11751-1 No score
afterburn-5.0.0-6.1 on GA media
These are all security issues fixed in the afterburn-5.0.0-6.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:11751-1- Updated
- 2026-11-02
OSVRUSTSEC-2021-0072 No score
Task dropped in wrong thread when aborting `LocalSet` task
When aborting a task with JoinHandle::abort, the future is dropped in the
thread calling abort if the task is not currently being executed. This is
incorrect for tasks spawned on a LocalSet.
This can easily result in race conditions as many projects use Rc or RefCell
in their Tokio tasks for better performance.
See tokio#3929 for more details.
- Record
RUSTSEC-2021-0072- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
tokiocrates.io |
1.8.0 up to 1.8.1 | 1.8.1 |
tokiocrates.io |
1.7.0 up to 1.7.2 | 1.7.2 |
tokiocrates.io |
1.6.0 up to 1.6.3 | 1.6.3 |
tokiocrates.io |
0.3.0 up to 1.5.1 | 1.5.1 |
tokiocrates.io |
0.3.0 up to 1.5.1, 1.6.0 up to 1.6.3, 1.7.0 up to 1.7.2, 1.8.0 up to 1.8.1 | 1.5.11.6.31.7.21.8.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| facts | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-38191 is a medium vulnerability (CVSS 5.9) in Tokio, published July 7, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.83%, the 57th percentile. Fixed in tokio 1.8.1.