Miggo Logo

CVE-2020-35913: Data races in lock_api

4.7

CVSS Score
3.1

Basic Information

EPSS Score
0.11943%
Published
8/25/2021
Updated
6/13/2023
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
lock_apirust< 0.4.20.4.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper trait bounds on Send/Sync implementations for various guard types. Specifically:

  1. RwLockReadGuard was marked as Sync without requiring T: Sync, allowing concurrent access to non-thread-safe data
  2. RwLockWriteGuard's Send implementation didn't require T: Send, enabling cross-thread transfer of mutable references to non-Send types
  3. Mapped guards inherited these flawed trait implementations These issues are confirmed by the advisory's list of affected types and the PR#262 fixes that added proper trait bounds (T: Sync for read guards, T: Send for write guards). The deref/deref_mut methods are vulnerable entry points as they provide access to the underlying data.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n issu* w*s *is*ov*r** in t** lo*k_*pi *r*t* ***or* *.*.* *or Rust. * **t* r*** **n o**ur ****us* o* RwLo*kR****u*r* unsoun*n*ss.

Reasoning

T** vuln*r**ility st*ms *rom improp*r tr*it *oun*s on S*n*/Syn* impl*m*nt*tions *or v*rious *u*r* typ*s. Sp**i*i**lly: *. RwLo*kR****u*r* w*s m*rk** *s Syn* wit*out r*quirin* T: Syn*, *llowin* *on*urr*nt ****ss to non-t*r***-s*** **t* *. RwLo*kWrit**