In the standard library in Rust before 1.49.0, String::retain() function has a panic…
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and Red Hat. Impact type from CWE-787 and the CVSS impact.
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
Remediation
Red Hat 2 advisories
- RHSA-2021:2243 Released 2021-06-03 · Red Hat rating Lowrust-toolset-1.49 and rust-toolset-1.49-rust update
- Red Hat Developer Tools for Red Hat Enterprise Linux Server (v. 7) rust-toolset-1.49-1.49.0-1.el7_9, rust-toolset-1.49-build-1.49.0-1.el7_9, rust-toolset-1.49-cargo-1.49.0-1.el7_9 +13
- Red Hat Developer Tools for Red Hat Enterprise Linux Workstation (v. 7) rust-toolset-1.49-1.49.0-1.el7_9, rust-toolset-1.49-build-1.49.0-1.el7_9, rust-toolset-1.49-cargo-1.49.0-1.el7_9 +13
- RHSA-2021:1935 Released 2021-05-18 · Red Hat rating Lowrust-toolset:rhel8 security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 8) cargo-1.49.0-1.module+el8.4.0+9446+1a463e08.aarch64::rust-toolset:rhel8, cargo-1.49.0-1.module+el8.4.0+9446+1a463e08.ppc64le::rust-toolset:rhel8, cargo-1.49.0-1.module+el8.4.0+9446+1a463e08.s390x::rust-toolset:rhel8 +40
Vendor assessments
Red Hat
Red Hat rating: Low. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Developer Tools for Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2021:2243 |
| Red Hat Developer Tools for Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2021:2243 |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2021:1935 |
Not affected: 1 product
- Red Hat Enterprise Linux 9
Timeline
- 2026-10-02 Threatist record created from CVE-2020-36317
- 2026-10-03 Alias added: GHSA-jc5q-p9cv-j8pj
References
More rust-lang Rust vulnerabilities
- TI-2024-16197 Rusts's `std::process::Command` did not properly escape arguments of batch files on Windows CVSS 3.1CRITICAL 10.0
- TI-2024-03325 Command injection vulnerability in programing languages on Microsoft Windows operating system. CVSS 3.1CRITICAL 9.8
- TI-2022-06036 Race condition in std::fs::remove_dir_all in rustlang CVSS 3.1HIGH 7.3
- TI-2018-16034 The Rust Programming Language Standard Library version 1.29.0, 1.28.0, 1.27.2, 1.27.1… CVSS 3.0CRITICAL 9.8
- TI-2021-11383 In the standard library in Rust before 1.52.0, a double free can occur in the… CVSS 3.1CRITICAL 9.8
- TI-2021-09849 In the standard library in Rust before 1.52.0, the Zip implementation can report an… CVSS 3.1CRITICAL 9.8
Sources
- CVE-2020-36317 · CVE Program
- CVE-2020-36317 · NVD
- FIRST EPSS
- GHSA-jc5q-p9cv-j8pj · GitHub Advisory Database · CC BY 4.0
- CVE-2020-36317 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences