7.5high
In the standard library in Rust before 1.49.0, String::retain() function has a panic safety problem.
- Severity
- 7.5high CVSS:3.1 by NVD
- Exploit likelihood
- 1.50% (higher than 74% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| rust-lang rust | before 1.49.0 | NVD |
All scores
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
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.
NVD (es)
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. Permite una creación de una cadena Rust que no sea UTF-8 cuando el cierre provisto entra en pánico. 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
References
| https://github.com/rust-lang/rust/issues/78498 | exploit, issue-tracking, third-party-advisory | |
| https://github.com/rust-lang/rust/pull/78499 | patch, third-party-advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-36317 changed 2024-08-04 | CVE Terms of Use |
| NVD | CVE-2020-36317 changed 2026-06-17 | Public domain |