Loading...
Skip to main content

CVE-2021-45710 — Race Condition in tokio — CVE Details

HIGH

Race Condition in tokio

Published January 6, 2022Updated November 8, 2023Source: osv

Summary

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.

Advisory Timeline

  • First published January 6, 2022 (1739 days ago).
  • Last revised November 8, 2023 — 670 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update tokio to 1.13.1 or later
cargo update -p tokio --precise 1.13.1
Cargo
Update tokio to 1.8.4 or later
cargo update -p tokio --precise 1.8.4

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: crates.io (1).

PackageEcosystemAffectedFixed In
tokio
crates.io
All versions1.13.1
tokio
crates.io
All versions1.8.4

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2021-45710?
Race Condition in tokio This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.1/10).
How do I check if my project is affected by CVE-2021-45710?
CVE-2021-45710 affects tokio. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-45710 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.1

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-fg7r-2g4j-5cgr
RUSTSEC-2021-0124

Related CVEs

  • CVE-2026-93657
    HIGH

    hickory-resolver: Resolver::lookup() and Resolver::lookup_ip() APIs obscure DNSSEC validation failures

  • CVE-2026-18140
    HIGH

    aws-smithy-json: Uncontrolled recursion in the aws-smithy-json unknown-key skip path allows unauthenticated remote denial of service in smithy-rs generated servers

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies