Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. futures-util
  4. ›
  5. CVE-2020-35905

CVE-2020-35905: MutexGuard::map can cause a data race in safe code

May 24, 2022 (updated June 13, 2023)

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

  • github.com/advisories/GHSA-rh4w-94hh-9943
  • github.com/rust-lang/futures-rs
  • github.com/rust-lang/futures-rs/issues/2239
  • nvd.nist.gov/vuln/detail/CVE-2020-35905
  • rustsec.org/advisories/RUSTSEC-2020-0059.html

Code Behaviors & Features

Detect and mitigate CVE-2020-35905 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.3.2 before 0.3.7

Fixed versions

  • 0.3.7

Solution

Upgrade to version 0.3.7 or above.

Impact 4.7 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

Source file

cargo/futures-util/CVE-2020-35905.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:27 +0000.