5.9medium
Race condition in tokio
- Severity
- 5.9medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.83% (higher than 55% of CVEs)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-2grh-hm3w-w7hvRUSTSEC-2021-0072
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| tokio (crates.io) | from 1.8.0 before 1.8.1, from 1.7.0 before 1.7.2, from 1.6.0 before 1.6.3, from 0.3.0 before 1.5.1 | GitHub Advisory Database, RustSec Advisory Database |
| tokio tokio | from 0.3.0 before 1.5.1, from 1.6.0 before 1.6.3, from 1.7.0 before 1.7.2, 1.8.0 | NVD |
All scores
| GitHub | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
RustSec Advisory Database
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.
NVD (es)
Se ha detectado un problema en la crate tokio versiones anteriores a 1.8.1 para Rust. Tras una función JoinHandle::abort, una Tarea puede ser lanzada en el hilo equivocado
References
| https://rustsec.org/advisories/RUSTSEC-2021-0072.html | advisory, exploit, issue-tracking, patch, third-party-advisory, web | |
| https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/tokio/RUSTSEC-2021-0072.md | third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-38191 | advisory | |
| https://github.com/tokio-rs/tokio/issues/3929 | report, web | |
| https://github.com/tokio-rs/tokio | package | |
| https://crates.io/crates/tokio | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-38191 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2grh-hm3w-w7hv changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0072 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-38191 changed 2026-06-17 | Public domain |