{"id":"CVE-2020-36317","details":"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.","modified":"2026-04-10T04:27:08.631672Z","published":"2021-04-11T20:15:12.390Z","references":[{"type":"REPORT","url":"https://github.com/rust-lang/rust/issues/78498"},{"type":"FIX","url":"https://github.com/rust-lang/rust/pull/78499"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/rust-lang/rust","events":[{"introduced":"0"},{"fixed":"e1884a8e3c3e813aada8254edfa120e85bf5ffca"}],"database_specific":{"versions":[{"introduced":"0"},{"fixed":"1.49.0"}]}}],"versions":["0.1","0.2","0.4","0.5","0.6","0.7","0.8","0.9","1.0.0-alpha","1.0.0-alpha.2","1.0.0-beta","release-0.1","release-0.2","release-0.4","release-0.5","release-0.6","release-0.7"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2020-36317.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}