CVE-2020-35873: Use after free in rusqlite
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.61007%
CWE
Published
8/25/2021
Updated
6/13/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
rusqlite | rust | < 0.23.0 | 0.23.0 |
Vulnerability Intelligence
Miggo AI
Root 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
.