Rust advisories / futures-util
Vulnerability MediumRUSTSEC-2020-0059 · futures-util
RUSTSEC-2020-0059: MutexGuard::map can cause a data race in safe code
Short answerA security vulnerability in the futures-util crate: MutexGuard::map can cause a data race in safe code. Medium severity (CVSS 4.7). Fixed in 0.3.7: update to a fixed version.
| Crate | futures-util |
|---|---|
| Type | Vulnerability (thread-safety) |
| Affected versions | From 0.3.2 before 0.3.7. |
| Fixed in | 0.3.7 |
| Severity | Medium, CVSS 4.7 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H |
| Published | 2020-10-22 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2020-35905, GHSA-rh4w-94hh-9943 |
| Affected functions | futures_util::lock::MutexGuard::map |
What to do
- See which version you have:
cargo tree -i futures-util(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p futures-util. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplefutures-util = "0.3.7") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Affected versions of the crate had a Send/Sync implementation for MappedMutexGuard that only considered variance on T, while MappedMutexGuard dereferenced to U.
This could of led to data races in safe Rust code when a closure used in MutexGuard::map() returns U that is unrelated to T.
The issue was fixed by fixing Send and Sync implementations, and by adding a PhantomData<&'a mut U> marker to the MappedMutexGuard type to tell the compiler that the guard is over U too.
References
- Package: crates.io/crates/futures-util
- Advisory: rustsec.org/advisories/RUSTSEC-2020-0059.html
- Report: github.com/rust-lang/futures-rs/issues/2239
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for futures-util
Up next
Same cratefutures-util: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?