Skip to main content

SurrealDB Core CVE-2026-121417

| EUVDEUVD-2026-115949 HIGH
Use After Free (CWE-416)
2026-11-03 VulnCheck GHSA-7wmw-j7vc-669r
8.8
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Embed surrealdb-core and hold Datastore/Transaction
  2. Delivery
    Invoke KV method dispatching to affinitypool::spawn_local
  3. Exploit
    Leak returned future via mem::forget
  4. Execution
    Drop transaction, ending borrows
  5. Persist
    Pool worker reads/writes freed mutex and transaction
  6. Impact
    Crash or memory corruption

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Not a default-configuration remote flaw. Exploitation requires ALL of: (1) a Rust program embedding surrealdb-core as a library and holding a public Datastore/Transaction (or Transactor); (2) calling a KV-backend method that dispatches blocking work into affinitypool::spawn_local - the advisory lists count, get/set point reads/writes, keys/keysr, scan/scanr, compact, shutdown, and open_keys_cursor/open_vals_cursor with next_batch/for_each on the rocksdb, mem and surrealkv backends; and (3) leaking the returned future via a safe mechanism (mem::forget, Box::leak, ManuallyDrop, an Rc/Arc cycle, or a leaked enclosing future) and then dropping the transaction while the pool worker is still running, so the future's Drop safety barrier never executes. LIMITING FACTORS: the vector is local/in-process (AV:L) - the vendor explicitly states no remote input (SurrealQL, JS, WASM, RPC) can reach the leak, so standard server deployments driven only by remote queries are not exposed; only builds whose Cargo.lock pins affinitypool 0.7.0 and whose kvs/ sources contain spawn_local call sites (versions before 3.3.0) are affected; and the embedder must itself commit the leak, so a correctly-written embedder that awaits or drops the future is not vulnerable.

Impact

Signals diverge sharply here. The CVSS 4.0 base score is 8.8 (High), but the vector itself tells the real story: AV:L (local, in-process), AC:H (high complexity), AT:P (a specific attack requirement must hold - an independent pool worker must still be using the borrows when they end), PR:L and UI:N. This is NOT a remotely reachable flaw. The vendor advisory is explicit that no remote input path (SurrealQL, JS, WASM, RPC) can trigger it, because no remote input can call mem::forget - only the embedder's own Rust code can leak the dispatched future. So the trigger is a soundness defect in the surrealdb-core public API that is reachable only when a Rust embedder leaks a future (mem::forget/Box::leak/ManuallyDrop/Rc-Arc cycle) and then drops the transaction. No CISA KEV listing is present (not confirmed actively exploited) and no EPSS score was provided, so the quantitative exploitation-probability signal is simply missing and cannot be weighed. The vuln.today decision label is 'this_week' - meaningful but explicitly NOT act_now or emergency. The GHSA advisory does publish a complete public-API PoC with an AddressSanitizer heap-use-after-free log, which raises credibility of the bug class, but PoC availability is a distinct signal from active exploitation and must not be conflated. Bottom line: this is a genuine, patch-worthy priority for anyone who embeds surrealdb-core as a Rust library, but the headline 8.8 overstates practical risk for standard remote/server deployments - it behaves much more like a constrained, local, embedder-dependent memory-safety bug than a widespread exploitable threat. One conflict to flag: the supplied CVSS 4.0 sets all subsequent-system metrics (SC/SI/SA) to High, implying a cross-system scope change, which the described single-process pool-worker UAF does not obviously support - verify with the vendor.

Exploit ScenarioDerived

A Rust application that embeds surrealdb-core holds a public Datastore/Transaction and calls a KV-backend method (e.g. Transactor::count on the RocksDB backend) whose blocking work is dispatched to affinitypool::spawn_local; the application then leaks the returned future with the safe mem::forget and drops the transaction while the pool worker is still scanning. The worker continues reading the freed MutexGuard/&Transaction and writes on mutex unlock, producing an AddressSanitizer-confirmed heap-use-after-free that risks crashes or memory corruption. The GHSA advisory publishes a complete public-API PoC source file and its full ASan log; the flaw is local/in-process only and cannot be reached through remote query, JS, WASM or RPC input.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 03, 2026

Use-after-free in SurrealDB Core before 3.3.0 can crash or corrupt memory in Rust applications that embed the database as a library. The defect affects KV backends that pass borrowed transaction state into affinitypool::spawn_local closures; the embedder must leak the returned future and then drop the transaction while a pool worker is still running, defeating the future's Drop-based safety barrier. Exploitation is local and in-process - remote SurrealQL, JS, WASM, or RPC input cannot reach the leak - and a proof-of-concept is documented in the advisory, though publicly available working exploit code is not confirmed in the provided data.

RemediationAI

Vendor-released patch: upgrade SurrealDB Core / the surrealdb Rust crate to 3.3.0, which includes the fix referenced by commit 17584a181979f04f2aaad867332c22db1caa511a and the advisory https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pm86-cc75-q463. Until the upgrade, embedders should ensure they never leak futures returned by KV/Transactor methods-avoid mem::forget, Box::leak, ManuallyDrop, and Rc/Arc cycles around those futures, and always await or explicitly drop them before dropping the transaction; this preserves the future's Drop barrier and prevents the pool worker from using freed transaction state. The limitation is that this is a coding discipline control rather than an enforced API boundary, and any downstream embedder that leaks such a future remains exposed. The upstream change making spawn_local unsafe is on the unreleased 0.8 branch and is not a substitute for the 3.3.0 release.

Affected VersionsENISA

surrealdb 0 <3.3.0

Affected Packages

euvd surrealdb fix: 3.3.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

SurrealDB Core's KV backends use affinitypool 0.7.0 spawn_local to move non-'static borrowed state-such as a tokio::sync::MutexGuard<Option<TransactionInner>>, &Transaction, scan state, guards, and RocksDB ReadOptions containing a raw rocksdb_snapshot_t*-onto pool workers. In affinitypool 0.7.0, spawn_local is a safe API whose soundness relies on the returned future's Drop implementation to cancel/park until the worker stops using those borrows; safe Rust can leak that future with mem::forget, Box::leak, ManuallyDrop, or an Rc/Arc cycle, ending the borrow while the worker still reads or writes the transaction allocation. This is CWE-416 use-after-free with related CWE-672 operation on a resource after expiration; AddressSanitizer reports a heap-use-after-free READ of the freed mutex data and a WRITE when the worker unlocks the freed tokio::sync::Mutex. The trigger requires a Rust embedder holding a public Datastore/Transaction/Transactor and calling a dispatching KV method, then leaking the future and dropping the transaction; it is not reachable from remote query input. Affected builds are those before 3.3.0 whose Cargo.lock pins affinitypool 0.7.0 and whose kvs sources contain spawn_local call sites; the vendor advisory identifies rocksdb, mem, and surrealkv paths and methods including count, get/set, keys/keysr, scan/scanr, compact, shutdown, and cursor operations. The assessed CVSS 3.1 vector is AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H (CVSS 8.8).

Know when Surrealdb gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.8 HIGH
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
vuln.today AI 7.0 HIGH

Trigger is in-process Rust code leaking a dispatched future (AV:L, AC:H, PR:L); memory corruption supports high C/I/A, but no cross-system scope change is described, so S:U.

3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:L/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
High
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
High

DescriptionCVE.org

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.

Technical POC Analysis

CWE-416 (use-after-free), reached without a single line of unsafe in the triggering code.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

SurrealDB Core versions before 3.3.0 contain a use-after-free vulnerability that can crash or corrupt memory in Rust applications embedding the database as a library. This requires a specific local development pattern-leaking a future and dropping a transaction while a pool worker is running-which is unlikely in production but poses a risk during development and testing. Leadership should prioritize patching embedded uses to prevent potential data corruption and application instability.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

Prevalence
Low
emerging multi-model database, modest production footprint, affects Rust embedders only
Social Media
1
Sightings
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
Medium

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

CVE-2025-71392 CRITICAL
9.4 Jul 18

Privilege escalation via second-order SurrealQL injection in SurrealDB before 2.0.5, 2.1.5, and 2.2.2 lets an authentica

CVE-2026-63756 CRITICAL
9.2 Jul 20

Privilege escalation in SurrealDB before v3.1.0 lets unauthenticated attackers hijack the privileges of concurrently-act

CVE-2026-63760 HIGH
8.7 Jul 20

Denial of service in SurrealDB before 3.1.0 lets an unauthenticated remote attacker crash the database with a single Web

CVE-2026-63747 HIGH
8.7 Jul 20

Denial of service in SurrealDB before 3.1.0 lets an unauthenticated remote attacker crash the entire database process wi

CVE-2026-63757 HIGH
8.7 Jul 20

Session hijacking in SurrealDB before 3.1.0 lets unauthenticated attackers enumerate attached session UUIDs through the

CVE-2026-109343 HIGH
8.6 Oct 12

SurrealDB versions before 3.3.0 fail to validate a caller's authorization level when the SurrealQL USE statement switche

CVE-2026-109334 HIGH
8.6 Oct 12

Cross-tenant data access in SurrealDB before 3.3.0 allows an authenticated namespace- or database-level SYSTEM user to b

CVE-2026-63735 HIGH POC
8.6 Jul 20

Cross-tenant authorization bypass in SurrealDB before 3.2.0 lets any authenticated user reach custom API endpoints belon

CVE-2026-121419 HIGH
8.6 Nov 03

Cross-user MCP session takeover in SurrealDB 3.1.0 through 3.2.x allows an authenticated holder of even a lowest-role JW

CVE-2026-63739 HIGH
8.3 Jul 20

Arbitrary file read in SurrealDB before 3.1.5 lets an authenticated database user holding the EDITOR or OWNER role discl

CVE-2026-63763 HIGH
7.5 Jul 20

Confused-deputy privilege escalation in SurrealDB before 2.5.0 and before 3.0.0-beta.3 lets a low-privileged user (e.g.

CVE-2026-63737 HIGH
7.1 Jul 20

Denial of service in SurrealDB before 3.1.5 lets an authenticated user with query-execution privileges crash the entire

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy