{"id":"CVE-2020-36317","aliases":["CVE-2020-36317"],"related":[],"kind":"vulnerability","state":"published","title":"In the standard library in Rust before 1.49.0, String::retain() function has a panic safety problem.","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En la biblioteca estándar en Rust versiones anteriores a 1.49.0, la función String::retener() presenta un problema de seguridad de pánico.&#xa0;Permite una creación de una cadena Rust que no sea UTF-8 cuando el cierre provisto entra en pánico.&#xa0;Este bug podría resultar en una violación de seguridad de la memoria cuando otras API de cadena asumen que es usada una codificación UTF-8 en la misma cadena","source":"nvd"}],"published":"2021-04-11T19:06:28.000Z","modified":"2026-06-17T03:15:17.623Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"status":"affected","fixed":"1.49.0"}],"vendor":"rust-lang","product":"rust","cpe":"cpe:2.3:a:rust-lang:rust:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/rust-lang/rust/issues/78498","tags":["exploit","issue-tracking","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/rust-lang/rust/pull/78499","tags":["patch","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-36317","url":"https://www.cve.org/CVERecord?id=CVE-2020-36317","licence":"CVE Terms of Use","modified":"2024-08-04T17:23:10.174Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-36317","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-36317","licence":"Public domain","modified":"2026-06-17T03:15:17.623Z"}],"updatedAt":"2026-11-25T22:57:57.765Z","epss":{"score":0.01496,"percentile":0.74957,"date":"2026-12-01T12:00:22.000Z"}}