CVE-2020-36212: Update unsound DrainFilter and RString::retain
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.59217%
CWE
Published
8/25/2021
Updated
2/3/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
abi_stable | rust | < 0.9.1 | 0.9.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two components:
- 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.
- 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.