{"id":"CVE-2026-121417","aliases":["CVE-2026-121417","RUSTSEC-2026-0453","GHSA-pm86-cc75-q463"],"related":[],"kind":"vulnerability","state":"published","title":"SurrealDB before 3.3.0 Use-After-Free via affinitypool spawn_local in KV Backends","summary":"SurrealDB before 3.3.0 contains a use-after-free vulnerability in surrealdb-core KV backends that pass borrowed transaction state into affinitypool::spawn_local closures relying on future Drop for safety. Rust embedders that leak a dispatched future (e.g. via mem::forget) and drop the transaction cause pool workers to read and write freed memory, risking crashes or memory corruption.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SurrealDB before 3.3.0 contains a use-after-free vulnerability in surrealdb-core KV backends that pass borrowed transaction state into affinitypool::spawn_local closures relying on future Drop for safety. Rust embedders that leak a dispatched future (e.g. via mem::forget) and drop the transaction cause pool workers to read and write freed memory, risking crashes or memory corruption.","source":"cvelist"},{"lang":"en","text":"The `kv-mem`, `kv-surrealkv` and `kv-rocksdb` backends move non-`'static` borrowed state into affinity-pool closures through `affinitypool::spawn_local`: a `tokio::sync::MutexGuard<Option<TransactionInner>>`, `&Transaction`, `&mut ScanStateKeys/Vals`, `&mut dyn KeyVisitor/ValVisitor`, `RwLockReadGuard`, and a `ReadOptions` holding a raw `rocksdb_snapshot_t*`. In `affinitypool 0.7.0` `spawn_local` is safe and erases the `'pool` lifetime via `async_task::Builder::spawn_unchecked`; the only thing keeping it sound is the `Drop` implementation of the returned future, which blocks until the worker stops using the borrows.\n\nSafe code can leak that future (`mem::forget`, `Box::leak`, `ManuallyDrop`, a reference cycle, or a leaked enclosing future). The borrows then end while the pool worker still uses them, producing a use-after-free on the transaction allocation; AddressSanitizer reports a read of freed mutex data and a write when the worker unlocks the freed `tokio::sync::Mutex` on the pool thread. No `unsafe` is required at the call site, and the affected methods include `count`, `keys`/`keysr`, `scan`/`scanr`, `compact`, shutdown, point reads and writes, and cursor iteration.\n\n3.3.0 upgrades to `affinitypool 0.8.0`, where `spawn_local` is an `unsafe` function and the caller must uphold the leak-freedom invariant (commit `8156ff69`).","format":"markdown","source":"rustsec"}],"published":"2026-10-19T12:00:00.000Z","modified":"2026-11-06T15:55:56.754Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","score":8.8,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"3.3.0","status":"affected"},{"type":"semver","version":"3.3.0","status":"unaffected"}],"vendor":"surrealdb","product":"surrealdb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"3.3.0"}],"ecosystem":"crates.io","package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"rustsec"}],"references":[{"url":"https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pm86-cc75-q463","tags":["exploit","vendor-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/surrealdb/surrealdb/commit/17584a181979f04f2aaad867332c22db1caa511a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://www.vulncheck.com/advisories/surrealdb-before-3.3.0-use-after-free-via-affinitypool-spawn-local-in-kv-backends","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://crates.io/crates/surrealdb","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0453.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/surrealdb/surrealdb/commit/8156ff691b1861814199e5e3372c81609b68db7f","tags":["web"],"sources":["rustsec"]}],"credits":["YZL0v3ZZ"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-11-03T17:06:00.194Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-121417","url":"https://www.cve.org/CVERecord?id=CVE-2026-121417","licence":"CVE Terms of Use","modified":"2026-11-03T17:06:36.341Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0453","url":"https://rustsec.org/advisories/RUSTSEC-2026-0453.html","licence":"CC0-1.0","modified":"2026-11-06T15:55:56.754Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-121417","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-121417","licence":"Public domain","modified":"2026-11-03T17:18:08.963Z"}],"updatedAt":"2026-11-25T22:59:48.443Z","epss":{"score":0.002,"percentile":0.10447,"date":"2026-12-01T12:00:22.000Z"}}