CVE-2020-36317

HIGH

Rust < 1.49.0 - Memory Safety Violation via String::retain() Panic

Title source: llm
STIX 2.1

Description

In the standard library in Rust before 1.49.0, String::retain() function has a panic safety problem. It allows creation of a non-UTF-8 Rust string when the provided closure panics. This bug could result in a memory safety violation when other string APIs assume that UTF-8 encoding is used on the same string.

References (2)

Core 2
Core References
Exploit, Issue Tracking, Third Party Advisory x_refsource_misc
https://github.com/rust-lang/rust/issues/78498
Patch, Third Party Advisory x_refsource_misc
https://github.com/rust-lang/rust/pull/78499

Scores

CVSS v3 7.5
EPSS 0.0151
EPSS Percentile 71.4%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Details

CWE
CWE-787
Status published
Products (1)
rust-lang/rust < 1.49.0
Published Apr 11, 2021
Tracked Since Feb 18, 2026