Miggo Logo

CVE-2020-36212: Update unsound DrainFilter and RString::retain

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.59217%
Published
8/25/2021
Updated
2/3/2023
KEV Status
No
Technology
TechnologyRust

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two components:

  1. DrainFilter's iterator implementation contains a double drop vulnerability due to improper handling of element removal and pointer manipulation, as shown in the vec/iters.rs code snippet. This matches the CWE-672 pattern of operating on resources after release.
  2. RString::retain contains unsafe UTF-8 manipulation that could create invalid string data, as demonstrated in the string.rs code and referenced in the standard library bug. Both functions were explicitly called out in the advisory as being copied from flawed std implementations (rust-lang/rust#60977 and rust-lang/rust#78498), with the fixes requiring similar patches to those applied in the Rust standard library.

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** **i_st**l* *r*t* ***or* *.*.* *or Rust. *r*in*ilt*r l**ks soun*n*ss ****us* o* * *ou*l* *rop.

Reasoning

T** vuln*r**ility st*ms *rom two *ompon*nts: *. *r*in*ilt*r's it*r*tor impl*m*nt*tion *ont*ins * *ou*l* *rop vuln*r**ility *u* to improp*r **n*lin* o* *l*m*nt r*mov*l *n* point*r m*nipul*tion, *s s*own in t** v**/it*rs.rs *o** snipp*t. T*is m*t***s