CVE-2020-36317

rust: memory safety violation in String::retain()

Published Apr 11, 2021 CVSS 3.1 · 7.5 High EPSS 1.5% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2020-23859 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.
History

No history.

Weaknesses

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Aug 4, 2024, 5:23 PM
Reserved
Apr 11, 2021, 12:00 AM
Status
Modified
Published
Apr 11, 2021, 8:15 PM
Modified
Jun 17, 2026, 3:15 AM
Severity
Low
Public date
Oct 28, 2020, 12:00 AM