Advisory

RUSTSEC-2020-0059

Also known as: CVE-2020-35905, GHSA-rh4w-94hh-9943

Summary

MutexGuard::map can cause a data race in safe code

Details

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.

Severity

Medium Basis: CVSS v3 score 4.7, vector CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H

Dates

Published
2020-10-22 12:00 UTC
Modified
2023-11-08 04:03 UTC

Affected packages and fixes

futures-util

crates.io · All systems

Affected

  • introduced 0.3.2, fixed 0.3.7 (semver)

Fixed versions

0.3.7

Fix

  • Fixed version 0.3.7
    cargo update -p futures-util --precise 0.3.7

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences