Every CVE Search/ Get API key

CVE-2021-38191

Race condition in tokio

5.9 MediumFix available

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

0.83%Up 0.2 points since Aug 8, 2021
90%50%10%1%

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 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
4.3 MediumAV: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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

Affected packages
PackageAffectedFixed
tokio
crates.io
1.8.0 up to 1.8.1
1.8.1
tokio
crates.io
1.7.0 up to 1.7.2
1.7.2
tokio
crates.io
1.6.0 up to 1.6.3
1.6.3
tokio
crates.io
0.3.0 up to 1.5.1
1.5.1
tokio
crates.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

History
RecordedChangedSources
facts
aliasesEUVD
first indexedCVE 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.

References

Show 8 moreShow less
MoveEnter Open