LiveActive security incident?Get immediate response
CVE Record

CVE-2020-36317: In the standard library in Rust before 1.49.0, String::retain() function has a panic safety problem.

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.

UnknownCVSS not scoredNot KEV-listedUpdated
Glexia's TakeAutomated analysisunknown

Security readout for executives and security teams

Plain-English summary

This is a Rust standard library bug fixed in Rust 1.49.0. Under a panic during String::retain(), a Rust string could be left in a state that is not valid UTF-8. Because other Rust string APIs assume UTF-8, this could lead to memory safety problems in affected programs.

Executive priority

Prioritize this for legacy Rust environments, especially services processing untrusted text. It is not documented as exploited, but memory safety in a standard library primitive warrants planned remediation where old toolchains remain in use.

Technical view

Rust before 1.49.0 had a panic-safety flaw in String::retain(). If the user-supplied closure panicked, the function could leave the String containing invalid UTF-8. Subsequent safe string APIs could then operate under broken invariants, creating a possible memory safety violation.

Likely exposure

Exposure is limited to Rust code built with Rust before 1.49.0 that uses String::retain() with a closure that can panic, then continues using the same String. The source bundle does not identify specific downstream products or packages.

Exploitation context

The sources do not state active exploitation, public weaponization, or KEV listing. Exploitation likelihood cannot be determined from the provided evidence. The vulnerability depends on application behavior around panics and continued use of the affected String.

Researcher notes

Key unanswered points are practical exploitability, reachable application patterns, and downstream affected products. Focus review on panic recovery behavior and invariant breakage after String::retain() panics. Do not assume broad exposure without confirming Rust version and call-site reachability.

Mitigation direction

  • Upgrade Rust toolchains and standard library to 1.49.0 or later.
  • Rebuild and redeploy Rust binaries after updating the toolchain.
  • Audit String::retain() uses where closures may panic.
  • Check vendor or Rust project guidance for affected legacy builds.

Validation and detection

  • Inventory Rust compiler versions used for production builds.
  • Identify code paths calling String::retain().
  • Review whether retain closures can panic under attacker-influenced input.
  • Confirm deployed binaries were rebuilt with Rust 1.49.0 or later.
Prepared
Confidence
medium
Sources
4

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cve · low confidence lookup

CVE-2020-36317 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Unknown
CVSS
Not scored
Known Exploited
No
Published
Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

0CVSS vectors
0Timeline events
0ADP providers
3Source links

CVSS and timeline data

No CVSS vectors or timeline events were available in the normalized CVE source material.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
n/an/an/aListed
Weakness

CWE details

No CWE listed

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.