CVE-2020-36317 Memory corruption in n/a

High 7.5 Published Updated

A panic safety flaw in Rust's String::retain allows creating invalid UTF-8 strings, leading to memory safety violations and potential code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2020-36317?

CVE-2020-36317 is a high-severity memory corruption vulnerability in n/a, published on 11 Apr 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-787

Which versions are affected by CVE-2020-36317?

It affects 1 product.

Products include Rust-Lang Rust.

How do I fix CVE-2020-36317?

Upgrade to a fixed version.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2020-36317 being exploited?

There is no known exploitation of CVE-2020-36317 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2020-36317, GHSA-jc5q-p9cv-j8pj, UBUNTU-CVE-2020-36317.

Is CVE-2020-36317 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free