Miggo Logo

CVE-2020-35873: Use after free in rusqlite

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.61007%
Published
8/25/2021
Updated
6/13/2023
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
rusqliterust< 0.23.00.23.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The commit diff shows critical changes in session.rs where temporary CStrings were being used to get raw pointers that could be invalidated. The vulnerability manifests in two session-related functions that passed string pointers to SQLite API calls without maintaining ownership of the underlying memory. The patch replaces these with SmallCString (which has different lifetime management) and explicitly stores the string objects before pointer extraction, directly addressing the use-after-free scenario described in CVE-2020-35873.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n issu* w*s *is*ov*r** in t** rusqlit* *r*t* ***or* *.**.* *or Rust. M*mory s***ty **n ** viol*t** ****us* s*ssions.rs **s * us*-**t*r-*r**.

Reasoning

T** *ommit *i** s*ows *riti**l ***n**s in `s*ssion.rs` w**r* t*mpor*ry `*Strin*s` w*r* **in* us** to **t r*w point*rs t**t *oul* ** inv*li**t**. T** vuln*r**ility m*ni**sts in two s*ssion-r*l*t** `*un*tions` t**t p*ss** strin* point*rs to `SQLit*` *P