CVE-2020-36317
published 2021-04-11CVE-2020-36317: 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…
PriorityP337high7.5CVSS 3.1
AVNACLPRNUINSUCNINAH
EPSS
1.51%
71.4th percentile
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.
Affected
5 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | rustc | < rustc 1.53.0+dfsg1-1 (bookworm) | rustc 1.53.0+dfsg1-1 (bookworm) |
| msrc | cbl_mariner_1.0_arm | — | — |
| msrc | cbl_mariner_1.0_x64 | — | — |
| msrc | cm1_rust_1.47.0-3_on_cbl_mariner_1.0 | — | — |
| rust-lang | rust | < 1.49.0 | 1.49.0 |
CVSS provenance
nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
nvdv2.05.0MEDIUMAV:N/AC:L/Au:N/C:N/I:N/A:P
osv7.5HIGH
vendor_debian7.5HIGH
vendor_msrc7.5HIGH
vendor_redhat7.5HIGH
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
GHSA-jc5q-p9cv-j8pj: In the standard library in Rust before 1
ghsa_unreviewed·2022-05-24
CVE-2020-36317 [HIGH] CWE-119 GHSA-jc5q-p9cv-j8pj: In the standard library in Rust before 1
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.
OSV
CVE-2020-36317: In the standard library in Rust before 1
osv·2021-04-11·CVSS 7.5
CVE-2020-36317 [HIGH] CVE-2020-36317: In the standard library in Rust before 1
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.
Microsoft
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 resul
vendor_msrc·2021-04-13·CVSS 7.5
CVE-2020-36317 [HIGH] CWE-787 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 resul
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.
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025.
Red Hat
rust: memory safety violation in String::retain()
vendor_redhat·2020-10-28·CVSS 7.5
CVE-2020-36317 [HIGH] CWE-119 rust: memory safety violation in String::retain()
rust: memory safety violation in String::retain()
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.
Package: rust (Red Hat Enterprise Linux 9) - Not affected
Debian
CVE-2020-36317: rustc - In the standard library in Rust before 1.49.0, String::retain() function has a p...
vendor_debian·2020·CVSS 7.5
CVE-2020-36317 [HIGH] CVE-2020-36317: rustc - In the standard library in Rust before 1.49.0, String::retain() function has a p...
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.
Scope: local
bookworm: resolved (fixed in 1.53.0+dfsg1-1)
bullseye: open
forky: resolved (fixed in 1.53.0+dfsg1-1)
sid: resolved (fixed in 1.53.0+dfsg1-1)
trixie: resolved (fixed in 1.53.0+dfsg1-1)
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
2021-04-11
Published