# CVE-2026-121417: SurrealDB use-after-free in KV backends via affinitypool spawn_local

Source: https://junglewise.ai/threats/cve-2026-121417-surrealdb-before-3-3-0-contains-a-use-after-free-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-03. Updated: 2026-11-03  
License: CC BY 4.0 with a link back

CVE-2026-121417 · Severity: high · CVSS 7.8 · Published 2026-11-03

SurrealDB is a database engine used to store and query data in applications. A use-after-free vulnerability in its transaction handling can allow attackers who control application code to cause memory corruption or crashes by exploiting how the system manages temporary memory references. This affects embedded Rust applications that use SurrealDB versions before 3.3.0.

Technologies: [surrealdb (crates.io)](https://junglewise.ai/threats/technologies/surrealdb), [Surrealdb-Core](https://junglewise.ai/threats/technologies/surrealdb-core). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io), [SurrealDB](https://junglewise.ai/threats/vendors/surrealdb).

## Quick answers

**Is CVE-2026-121417 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-121417 being exploited in the wild.

**How severe is CVE-2026-121417?** High severity, with a CVSS score of 7.8, published 3 November 2026.

**Which products and versions are affected?** surrealdb (crates.io) SEMVER:introduced=0.0.0-0,fixed=3.3.0; Surrealdb-Core before 3.3.0.

**Is there a fix for CVE-2026-121417?** Yes. surrealdb (crates.io): upgrade to 3.3.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-121417 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-121417?** Check whether you run surrealdb (crates.io) or Surrealdb-Core at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- surrealdb (crates.io): upgrade to 3.3.0 or later

  ```sh
  cargo update -p surrealdb
  ```


## Technical details

The vulnerability is a use-after-free in surrealdb-core's KV backends where borrowed transaction state is passed into affinitypool::spawn_local closures; soundness depends on the future's Drop implementation, which can be circumvented by leaking the future via mem::forget or similar mechanisms. When a future is leaked and the transaction is dropped while pool workers still reference the freed memory, heap-use-after-free occurs on reads and writes. Exploitation requires control over Rust code that can construct and leak a future from the public Transaction/Transactor API; no unsafe code is needed at the call site.

## Affected products

- SurrealDB surrealdb-core before 3.3.0

## Identifiers

- CVE-2026-121417
- GHSA-pm86-cc75-q463
- RUSTSEC-2026-0453

## Timeline

- 2026-10-19: disclosed: Security advisory GHSA-pm86-cc75-q463 published
- 2026-11-03: advisory: CVE-2026-121417 published

## References

- [https://github.com/surrealdb/surrealdb/commit/17584a181979f04f2aaad867332c22db1caa511a](https://github.com/surrealdb/surrealdb/commit/17584a181979f04f2aaad867332c22db1caa511a)
- [https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pm86-cc75-q463](https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pm86-cc75-q463)

## Related threats

- [SurrealDB JSON parser denial of service via uncontrolled recursion](https://junglewise.ai/threats/surrealdb-json-parser-denial-of-service-via-uncontrolled-recursion-3037f8a0)
- [SurrealDB ES512 algorithm silently downgraded to ES384](https://junglewise.ai/threats/surrealdb-es512-algorithm-silently-downgraded-to-es384-f0af29b8)
- [SurrealDB permission bypass via WHERE clause evaluation](https://junglewise.ai/threats/surrealdb-permission-bypass-via-where-clause-evaluation-afa6f001)
- [SurrealDB authorization bypass in KILL statement](https://junglewise.ai/threats/surrealdb-authorization-bypass-in-kill-statement-fc230d0f)
- [SurrealDB port-specific deny-net rule bypass on HTTP redirect](https://junglewise.ai/threats/surrealdb-port-specific-deny-net-rule-bypass-on-http-redirect-855c5516)
