Skip to main content
← Vulnerabilities

Use-after-free in KV backends via leaked `affinitypool::spawn_local` future

Exploited
No known exploitation
Fix
Fixed in 3.3.0
Who is exposed
Not reported

Do first: Upgrade to a fixed version: 3.3.0.

Published
Last modified
10/100 · provisional
None on Exploit-DB, Metasploit or GitHub

Summary

The `kv-mem`, `kv-surrealkv`, and `kv-rocksdb` storage backends can read and write freed memory when a pool worker keeps using borrowed data after the future that owns it has been leaked. Safe code can trigger this by leaking the future, with no `unsafe` code at the call site, and it affects operations such as `count`, `scan`, `compact`, and point reads and writes.

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

Read the original description

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.

Safe 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.

3.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).

cve.now Index

10Pcve.now Index 10 of 100 · methodology v3 · provisional
  • Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
  • Exposure?/25Unknown. No advisory context yet
  • Reach10/20Affects crates.io packages
  • Severity?/10Unknown. No CVSS score or vendor rating
  • No patch0/5No signal

What would change the score

  • Would score about 65 if added to CISA KEV
  • Would score about 60 if CISA's SSVC rates exploitation active
  • Would score about 32 if advisories confirm default setups are exposed

Impact

  • Widely used

    surrealdb has 44.7k weekly downloads.Source: crates.io

What to do

  • Upgrade to a fixed version: 3.3.0.

Timeline

  1. Advisory published18 days
  2. Record last updated

Affected versions

  • surrealdbcrates.io

    From 0.0.0-0 · fixed in 3.3.0

    Fixed in 3.3.0 (released Sep 24, 2026, 25 days before disclosure).

    The latest release, 4.0.0, is not affected.

Evidence 3

  1. Advisory
  2. Repository
  3. Link

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

Questions about RUSTSEC-2026-0453

Is RUSTSEC-2026-0453 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data

Which versions are affected by RUSTSEC-2026-0453?

surrealdb (crates.io): from 0.0.0-0 before 3.3.0.Source: cve.now feed data

How do I fix RUSTSEC-2026-0453?

Upgrade to a fixed version: 3.3.0.Source: cve.now feed data