CVE-2020-36317
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
rust-lang rustbefore 1.49.0NVD

All scores

NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.0medium CVSS:2.0AV: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/78498exploit, issue-tracking, third-party-advisory
https://github.com/rust-lang/rust/pull/78499patch, third-party-advisory

Sources

SourceRecordLicence
CVE ListCVE-2020-36317 changed 2024-08-04CVE Terms of Use
NVDCVE-2020-36317 changed 2026-06-17Public domain