CVE-2021-45719: Use After Free in rusqlite
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.51056%
CWE
Published
1/6/2022
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:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
rusqlite | rust | >= 0.25.0, < 0.25.4 | 0.25.4 |
rusqlite | rust | >= 0.26.0, < 0.26.2 | 0.26.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from incorrect lifetime bounds on closure parameters in various hook/function registration methods. The RustSec advisory (RUSTSEC-2021-0128) explicitly lists these functions as vulnerable due to their ability to accept closures that might capture stack-allocated values. The GitHub issue #1048 demonstrates a concrete use-after-free scenario with update_hook
, and the advisory explains the pattern applies to all listed functions that register callbacks with SQLite
. The functions are grouped by feature flags (hooks/functions/collation
) but share the same core lifetime management flaw.