{"id":"CVE-2021-38191","aliases":["CVE-2021-38191","GHSA-2grh-hm3w-w7hv","RUSTSEC-2021-0072"],"related":[],"kind":"vulnerability","state":"published","title":"Race condition in tokio","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"When aborting a task with `JoinHandle::abort`, the future is dropped in the\nthread calling abort if the task is not currently being executed. This is\nincorrect for tasks spawned on a `LocalSet`.\n\nThis can easily result in race conditions as many projects use `Rc` or `RefCell`\nin their Tokio tasks for better performance.\n\nSee [tokio#3929][issue] for more details.\n\n[issue]: https://github.com/tokio-rs/tokio/issues/3929","format":"markdown","source":"rustsec"},{"lang":"es","text":"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","source":"nvd"}],"published":"2021-07-07T12:00:00.000Z","modified":"2026-06-17T04:01:43.753Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:N/A:P","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-362","CWE-366"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.8.0","status":"affected","fixed":"1.8.1"}],"ecosystem":"crates.io","package":"tokio","purl":"pkg:cargo/tokio","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.7.0","status":"affected","fixed":"1.7.2"}],"ecosystem":"crates.io","package":"tokio","purl":"pkg:cargo/tokio","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.6.0","status":"affected","fixed":"1.6.3"}],"ecosystem":"crates.io","package":"tokio","purl":"pkg:cargo/tokio","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.3.0","status":"affected","fixed":"1.5.1"}],"ecosystem":"crates.io","package":"tokio","purl":"pkg:cargo/tokio","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.3.0","status":"affected","fixed":"1.5.1"},{"type":"semver","introduced":"1.6.0","status":"affected","fixed":"1.6.3"},{"type":"semver","introduced":"1.7.0","status":"affected","fixed":"1.7.2"},{"type":"semver","introduced":"1.8.0","status":"affected","fixed":"1.8.1"}],"ecosystem":"crates.io","package":"tokio","purl":"pkg:cargo/tokio","source":"rustsec"},{"ranges":[{"status":"affected","introduced":"0.3.0","fixed":"1.5.1"},{"status":"affected","introduced":"1.6.0","fixed":"1.6.3"},{"status":"affected","introduced":"1.7.0","fixed":"1.7.2"},{"status":"affected","version":"1.8.0"}],"vendor":"tokio","product":"tokio","cpe":"cpe:2.3:a:tokio:tokio:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0072.html","tags":["advisory","exploit","issue-tracking","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/tokio/RUSTSEC-2021-0072.md","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-38191","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/tokio-rs/tokio/issues/3929","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/tokio-rs/tokio","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/tokio","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-38191","url":"https://www.cve.org/CVERecord?id=CVE-2021-38191","licence":"CVE Terms of Use","modified":"2024-08-04T01:37:16.274Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2grh-hm3w-w7hv","url":"https://github.com/advisories/GHSA-2grh-hm3w-w7hv","licence":"CC-BY-4.0","modified":"2023-11-08T04:06:25.982Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0072","url":"https://rustsec.org/advisories/RUSTSEC-2021-0072.html","licence":"CC0-1.0","modified":"2023-11-08T04:06:25.982Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-38191","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-38191","licence":"Public domain","modified":"2026-06-17T04:01:43.753Z"}],"updatedAt":"2026-11-25T22:58:03.054Z","epss":{"score":0.00833,"percentile":0.54928,"date":"2026-11-30T12:00:22.000Z"}}