GHSA-2grh-hm3w-w7hv

Suggest an improvement
Source
https://github.com/advisories/GHSA-2grh-hm3w-w7hv
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/08/GHSA-2grh-hm3w-w7hv/GHSA-2grh-hm3w-w7hv.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-2grh-hm3w-w7hv
Aliases
Published
2021-08-25T20:55:51Z
Modified
2023-11-01T04:55:57.733578Z
Severity
  • 5.9 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Race condition in tokio
Details

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.

References

Affected packages

crates.io / tokio

Package

Affected ranges

Type
SEMVER
Events
Introduced
1.8.0
Fixed
1.8.1

Ecosystem specific

{
    "affected_functions": [
        "tokio::task::JoinHandle::abort"
    ]
}

crates.io / tokio

Package

Affected ranges

Type
SEMVER
Events
Introduced
1.7.0
Fixed
1.7.2

Ecosystem specific

{
    "affected_functions": [
        "tokio::task::JoinHandle::abort"
    ]
}

crates.io / tokio

Package

Affected ranges

Type
SEMVER
Events
Introduced
1.6.0
Fixed
1.6.3

Ecosystem specific

{
    "affected_functions": [
        "tokio::task::JoinHandle::abort"
    ]
}

crates.io / tokio

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.3.0
Fixed
1.5.1

Ecosystem specific

{
    "affected_functions": [
        "tokio::task::JoinHandle::abort"
    ]
}