CVE-2021-45710
JSON

8.1high

Race Condition in tokio

Severity
8.1high CVSS:3.1 by NVD
Exploit likelihood
1.24% (higher than 69% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-fg7r-2g4j-5cgrRUSTSEC-2021-0124

Description

An issue was discovered in the tokio crate before 1.8.4, and 1.9.x through 1.13.x before 1.13.1, for Rust. In certain circumstances involving a closed oneshot channel, there is a data race and memory corruption.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
tokio (crates.io)from 0.1.14 before 1.8.4, from 1.9.0 before 1.13.1GitHub Advisory Database, RustSec Advisory Database
tokio tokiofrom 0.1.14 before 1.8.4, from 1.9.0 before 1.13.1NVD

All scores

GitHub8.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD8.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD5.1medium CVSS:2.0AV:N/AC:H/Au:N/C:P/I:P/A:P

Classification

What each source says

CVE List

An issue was discovered in the tokio crate before 1.8.4, and 1.9.x through 1.13.x before 1.13.1, for Rust. In certain circumstances involving a closed oneshot channel, there is a data race and memory corruption.

GitHub Advisory Database

If a tokio::sync::oneshot channel is closed (via the oneshot::Receiver::close method), a data race may occur if the oneshot::Sender::send method is called while the corresponding oneshot::Receiver is awaited or calling try_recv.

When these methods are called concurrently on a closed channel, the two halves of the channel can concurrently access a shared memory location, resulting in a data race. This has been observed to cause memory corruption.

Note that the race only occurs when both halves of the channel are used after the Receiver half has called close. Code where close is not used, or where the Receiver is not awaited and try_recv is not called after calling close, is not affected.

RustSec Advisory Database

If a tokio::sync::oneshot channel is closed (via the oneshot::Receiver::close method), a data race may occur if the oneshot::Sender::send method is called while the corresponding oneshot::Receiver is awaited or calling try_recv.

When these methods are called concurrently on a closed channel, the two halves of the channel can concurrently access a shared memory location, resulting in a data race. This has been observed to cause memory corruption.

Note that the race only occurs when both halves of the channel are used after the Receiver half has called close. Code where close is not used, or where the Receiver is not awaited and try_recv is not called after calling close, is not affected.

See tokio#4225 for more details.

NVD (es)

Se ha detectado un problema en la crate tokio versiones anteriores a 1.8.4, y de la 1.9.x a la 1.13.x anteriores a 1.13.1, para Rust. En determinadas circunstancias que implican un canal cerrado oneshot, se presenta una carrera de datos y corrupción de memoria

References

Sources

SourceRecordLicence
CVE ListCVE-2021-45710 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-fg7r-2g4j-5cgr changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0124 changed 2023-11-08CC0-1.0
NVDCVE-2021-45710 changed 2026-06-17Public domain