{"id":"CVE-2021-45718","aliases":["CVE-2021-45718","GHSA-4qr3-m7ww-hh9g","GHSA-87xh-9q6h-r5cc","GHSA-92cx-4xm7-jr9m","GHSA-cm8g-544f-p9x9","GHSA-f6f2-3w33-54r9","GHSA-g4g4-3pqw-8m7f","GHSA-g87r-23vw-7f87","GHSA-q89g-4vhh-mvvm","RUSTSEC-2021-0128"],"related":["CVE-2021-45713","CVE-2021-45714","CVE-2021-45715","CVE-2021-45716","CVE-2021-45717","CVE-2021-45719"],"kind":"vulnerability","state":"published","title":"Use After Free in rusqlite","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.\n\nThe impacted functions are:\n\n- Under `cfg(feature = \"functions\")`: `Connection::create_scalar_function`, `Connection::create_aggregate_function` and `Connection::create_window_function`.\n- Under `cfg(feature = \"hooks\")`: `Connection::commit_hook`, `Connection::rollback_hook` and `Connection::update_hook`.\n- Under `cfg(feature = \"collation\")`: `Connection::create_collation`.\n\nThe 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`).\n\nThe 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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","source":"nvd"}],"published":"2021-12-07T12:00:00.000Z","modified":"2026-06-17T04:14:00.687Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"rating","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.25.0","status":"affected","fixed":"0.25.4"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.26.0","status":"affected","fixed":"0.26.2"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.25.0","status":"affected","fixed":"0.25.4"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.26.0","status":"affected","fixed":"0.26.2"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.25.0","status":"affected","fixed":"0.25.4"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.26.0","status":"affected","fixed":"0.26.2"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.25.0","status":"affected","fixed":"0.25.4"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.26.0","status":"affected","fixed":"0.26.2"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.25.0","status":"affected","fixed":"0.25.4"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.26.0","status":"affected","fixed":"0.26.2"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.25.0","status":"affected","fixed":"0.25.4"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.26.0","status":"affected","fixed":"0.26.2"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.25.0","status":"affected","fixed":"0.25.4"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.26.0","status":"affected","fixed":"0.26.2"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.26.0","status":"affected","fixed":"0.26.2"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.25.0","status":"affected","fixed":"0.25.4"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.25.0","status":"affected","fixed":"0.25.4"},{"type":"semver","introduced":"0.26.0-0","status":"affected","fixed":"0.26.2"}],"ecosystem":"crates.io","package":"rusqlite","purl":"pkg:cargo/rusqlite","source":"rustsec"},{"ranges":[{"status":"affected","introduced":"0.25.0","fixed":"0.25.4"},{"status":"affected","introduced":"0.26.0","fixed":"0.26.2"}],"vendor":"rusqlite_project","product":"rusqlite","cpe":"cpe:2.3:a:rusqlite_project:rusqlite:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0128.html","tags":["advisory","exploit","issue-tracking","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/rusqlite/RUSTSEC-2021-0128.md","tags":["exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45717","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rusqlite/rusqlite/issues/1048","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/rusqlite/rusqlite","tags":["package","web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45715","tags":["advisory"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45713","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rusqlite/rusqlite/pull/1049","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rusqlite/rusqlite/commit/30f8c8c502675011603c4d066396bf317fd49e71","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rusqlite/rusqlite/commit/612158507e90f41d409cd0fa80eb21c992b1bc08","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rusqlite/rusqlite/commit/934e0c709e156753881da98b32e9853f9ffe4a1b","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rusqlite/rusqlite/commit/f4f95f8caf9fd53bffd0c19530be2484c644cc16","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45716","tags":["advisory"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45714","tags":["advisory"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45718","tags":["advisory"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45719","tags":["advisory"],"sources":["ghsa"]},{"url":"https://crates.io/crates/rusqlite","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-45718","url":"https://www.cve.org/CVERecord?id=CVE-2021-45718","licence":"CVE Terms of Use","modified":"2024-08-04T04:47:02.130Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4qr3-m7ww-hh9g","url":"https://github.com/advisories/GHSA-4qr3-m7ww-hh9g","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:18.748Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-87xh-9q6h-r5cc","url":"https://github.com/advisories/GHSA-87xh-9q6h-r5cc","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:18.748Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-92cx-4xm7-jr9m","url":"https://github.com/advisories/GHSA-92cx-4xm7-jr9m","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:18.748Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cm8g-544f-p9x9","url":"https://github.com/advisories/GHSA-cm8g-544f-p9x9","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:18.748Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f6f2-3w33-54r9","url":"https://github.com/advisories/GHSA-f6f2-3w33-54r9","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:18.748Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g4g4-3pqw-8m7f","url":"https://github.com/advisories/GHSA-g4g4-3pqw-8m7f","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:18.748Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g87r-23vw-7f87","url":"https://github.com/advisories/GHSA-g87r-23vw-7f87","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:18.748Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q89g-4vhh-mvvm","url":"https://github.com/advisories/GHSA-q89g-4vhh-mvvm","licence":"CC-BY-4.0","modified":"2024-03-15T00:05:18.748Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0128","url":"https://rustsec.org/advisories/RUSTSEC-2021-0128.html","licence":"CC0-1.0","modified":"2024-03-15T00:05:18.748Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-45718","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45718","licence":"Public domain","modified":"2026-06-17T04:14:00.687Z"}],"updatedAt":"2026-11-25T22:58:06.257Z","epss":{"score":0.01219,"percentile":0.6949,"date":"2026-12-01T12:00:22.000Z"}}