Files
advisory-db/rust/std/CVE-2020-36317.md
2021-04-13 14:22:28 -07:00

635 B

[advisory]
id = "CVE-2020-36317"
package = "std"
categories = ["memory-corruption"]
date = "2020-10-28"
url = "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-36317"

[versions]
patched = [">= 1.49.0"]
unaffected = ["< 1.26.0"]

String::retain allows safely creating invalid strings when abusing panic

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.