7.5high
Use After Free in rusqlite
- Severity
- 7.5high CVSS:3.1 by NVD
- Exploit likelihood
- 1.22% (higher than 69% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-4qr3-m7ww-hh9gGHSA-87xh-9q6h-r5ccGHSA-92cx-4xm7-jr9mGHSA-cm8g-544f-p9x9GHSA-f6f2-3w33-54r9GHSA-g4g4-3pqw-8m7fGHSA-g87r-23vw-7f87GHSA-q89g-4vhh-mvvmRUSTSEC-2021-0128
Description
An issue was discovered in the rusqlite crate 0.25.x before 0.25.4 and 0.26.x before 0.26.2 for Rust. rollback_hook has a use-after-free.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| rusqlite (crates.io) | from 0.25.0 before 0.25.4, from 0.26.0 before 0.26.2, from 0.26.0-0 before 0.26.2 | GitHub Advisory Database, RustSec Advisory Database |
| rusqlite_project rusqlite | from 0.25.0 before 0.25.4, from 0.26.0 before 0.26.2 | NVD |
All scores
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| GitHub | high rating | |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
An issue was discovered in the rusqlite crate 0.25.x before 0.25.4 and 0.26.x before 0.26.2 for Rust. rollback_hook has a use-after-free.
GitHub Advisory Database
An issue was discovered in the rusqlite crate 0.25.x before 0.25.4 and 0.26.x before 0.26.2 for Rust. commit_hook has a use-after-free.
GitHub Advisory Database
An issue was discovered in the rusqlite crate 0.25.x before 0.25.4 and 0.26.x before 0.26.2 for Rust. create_window_function has a use-after-free.
GitHub Advisory Database
An issue was discovered in the rusqlite crate 0.25.x before 0.25.4 and 0.26.x before 0.26.2 for Rust. create_scalar_function has a use-after-free.
GitHub Advisory Database
An issue was discovered in the rusqlite crate 0.25.x before 0.25.4 and 0.26.x before 0.26.2 for Rust. create_collation has a use-after-free.
GitHub Advisory Database
An issue was discovered in the rusqlite crate 0.25.x before 0.25.4 and 0.26.x before 0.26.2 for Rust. create_aggregate_function has a use-after-free.
GitHub Advisory Database
An issue was discovered in the rusqlite crate 0.25.x before 0.25.4 and 0.26.x before 0.26.2 for Rust. update_hook has a use-after-free.
GitHub Advisory Database
The lifetime bound on several closure-accepting rusqlite functions (specifically, functions which register a callback to be later invoked by SQLite) was too relaxed. If a closure referencing borrowed values on the stack is was passed to one of these functions, it could allow Rust code to access objects on the stack after they have been dropped.
The impacted functions are:
- Under
cfg(feature = "functions"):Connection::create_scalar_function,Connection::create_aggregate_functionandConnection::create_window_function. - Under
cfg(feature = "hooks"):Connection::commit_hook,Connection::rollback_hookandConnection::update_hook. - Under
cfg(feature = "collation"):Connection::create_collation.
The issue exists in all 0.25.* versions prior to 0.25.4, and all 0.26.* versions prior to 0.26.2 (specifically: 0.25.0, 0.25.1, 0.25.2, 0.25.3, 0.26.0, and 0.26.1).
The fix is available in versions 0.26.2 and newer, and also has been back-ported to 0.25.4. As it does not exist in 0.24.*, all affected versions should have an upgrade path to a semver-compatible release.
NVD (es)
Se ha detectado un problema en la crate rusqlite versiones 0.25.x anteriores a 0.25.4 y versiones 0.26.x anteriores a 0.26.2 para Rust. La función rollback_hook presenta un uso de memoria previamente liberada
References
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-45718 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4qr3-m7ww-hh9g changed 2024-03-15 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-87xh-9q6h-r5cc changed 2024-03-15 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-92cx-4xm7-jr9m changed 2024-03-15 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-cm8g-544f-p9x9 changed 2024-03-15 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-f6f2-3w33-54r9 changed 2024-03-15 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-g4g4-3pqw-8m7f changed 2024-03-15 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-g87r-23vw-7f87 changed 2024-03-15 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-q89g-4vhh-mvvm changed 2024-03-15 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0128 changed 2024-03-15 | CC0-1.0 |
| NVD | CVE-2021-45718 changed 2026-06-17 | Public domain |