Skip to main content

SurrealDB EUVDEUVD-2025-210488

| CVE-2025-71397 HIGH
Loop with Unreachable Exit Condition (Infinite Loop) (CWE-835)
2026-07-18 VulnCheck GHSA-33m9-4q46-9q55
7.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Authenticate with OWNER/EDITOR role
  2. Delivery
    Connect to SurrealQL query interface
  3. Exploit
    DEFINE FUNCTION with nested FOR loops
  4. Execution
    Invoke function with millions of iterations
  5. Persist
    CPU fully consumed, timeouts bypassed
  6. Impact
    Server unresponsive until manual restart

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Loop termination conditions
MITRE ATT&CK

1 technique across 1 tactic: Impact

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

Exploitation Conditions

Requires an authenticated account with OWNER or EDITOR permission at the root, namespace, or database level (PR:L) and that the instance permits custom function definition - i.e. the DEFINE FUNCTION capability is not already restricted via --deny-functions/--allow-functions. The attacker must be able to reach the query interface over the network (AV:N) and craft a function using nested FOR loops whose combined iteration count is large; no user interaction is needed. Exploitation is LIMITED by the privilege requirement (users without OWNER/EDITOR cannot define functions) and by any pre-existing function-capability restrictions, which is why this is realistically an insider/post-credential-compromise DoS rather than an anonymous one.

Impact

The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N, VA:H, all other impacts N) scores 7.1 and cleanly matches the description: network-reachable, low complexity, requires low privileges, and produces pure availability impact with no confidentiality or integrity loss. This is a genuine and easily weaponizable DoS, but its real-world risk is gated by the PR:L requirement - the attacker must already hold OWNER or EDITOR permissions at root, namespace, or database level, so this is primarily an insider or post-compromise/credential-abuse concern rather than an anonymous internet attack. No EPSS score was supplied, it is not listed in CISA KEV, and no POC was published, so there is no evidence of active or automated exploitation; however, the advisory fully describes the technique, making reproduction trivial for anyone with the required role. Net priority: patch promptly on any multi-tenant or shared SurrealDB deployment where non-admin principals hold EDITOR/OWNER, lower urgency where only fully trusted operators have those rights.

Exploit ScenarioDerived

An analyst or application account holding EDITOR rights on a shared SurrealDB namespace issues a single DEFINE FUNCTION creating a body of several nested FOR loops each iterating one million times, then calls it. The server pins all CPU on that call, ignores configured timeouts, and stops answering queries or accepting new connections until an operator forcibly restarts the process; no exploit tooling is needed beyond a normal SurrealQL client.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jul 18, 2026

Denial of service in SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 lets an authenticated user with OWNER or EDITOR rights define a custom function containing nested FOR loops that bypasses per-loop iteration limits and consumes all server CPU, ignoring configured query timeouts. The multiplicative iteration count (e.g. several nested loops of 1,000,000 each) monopolizes the process until it is manually killed, blocking all other queries and new connections. Discovered during a cure53 audit; no public exploit identified at time of analysis and it is not on CISA KEV, though the technique is trivially reproducible from the advisory.

RemediationAI

Vendor-released patch: upgrade to SurrealDB 2.0.5, 2.1.5, or 2.2.2 (or later), which add a per-iteration context-cancellation/timeout check in ForEachStatement (fix in PR https://github.com/surrealdb/surrealdb/pull/5597; advisory GHSA-pxw4-94j3-v9pf). For deployments that cannot upgrade immediately, restrict custom function execution using the capabilities controls: set --deny-functions (or SURREAL_CAPS_DENY_FUNC) to block all custom functions, or use --allow-functions / SURREAL_CAPS_ALLOW_FUNC to permit only a vetted allowlist of trusted functions (see https://surrealdb.com/docs/surrealdb/security/capabilities#functions); the trade-off is that legitimate custom SurrealQL functions will be blocked or limited, which may break application logic. As a complementary control, minimize the number of principals granted OWNER or EDITOR at root/namespace/database scope, since those roles are the exploitation prerequisite.

Affected VersionsENISA

surrealdb 0 <2.2.2
surrealdb 0 <2.0.5
surrealdb 0 <2.1.5

Affected Packages

cargo surrealdb fix: 2.0.5, 2.1.5, 2.2.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in cargo

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

Technical ContextAI · show details

SurrealDB is a Rust-based multi-model database that exposes SurrealQL, a query language supporting user-defined logic via the DEFINE FUNCTION statement and FOR loop control flow. The root cause is CWE-835 (Loop with Unreachable Exit Condition / infinite loop): while the parser and interpreter cap the iteration count of a single FOR loop, they do not bound the combined cost of nested loops, so nesting N loops of one million iterations yields up to 10^(6N) executions. Critically, the ForEachStatement iteration path did not check for context cancellation, meaning configured statement/transaction timeouts never fired during the tight loop. The fix (PR #5597) adds a per-iteration check for context cancellation or timeout inside ForEachStatement so long-running loops can be aborted. Affected CPE is cpe:2.3:a:surrealdb:surrealdb across the listed version ranges.

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 7.1 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 6.5 MEDIUM

Network-reachable SurrealQL interface (AV:N) with low complexity, but defining functions requires OWNER/EDITOR privileges (PR:L); impact is pure availability DoS (A:H) with no confidentiality or integrity effect and no scope change.

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

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

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

Lifecycle Timeline

2
Patch available
Jul 18, 2026 - 15:17 EUVD
CVE Published
Jul 18, 2026 - 13:10 cve.org
HIGH 7.1

DescriptionCVE.org

SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 allows authenticated users with OWNER or EDITOR permissions (at the root, namespace, or database level) to define custom database functions via DEFINE FUNCTION using nested FOR loops. Although a single loop's iteration count is constrained, nesting multiple loops (e.g., each with 1,000,000 iterations) is not, so an attacker can execute a function that consumes all server CPU time. Configured timeouts do not stop the execution, rendering the server unresponsive to other queries and connections until it is manually restarted.

Executive ViewAI

Why It Matters

SurrealDB deployments face authenticated denial-of-service risk where privileged users can design custom functions with nested loops to exhaust server CPU and disable database operations for all other users. Organizations should immediately assess which instances are affected and tighten access controls for elevated roles.

Business Impact: High
Compensating Controls

Restrict OWNER and EDITOR role assignments to essential trusted personnel only; implement strict query timeout enforcement at the application layer; disable custom function functionality if operationally unnecessary; enable and monitor SurrealDB logs for function creation events and abnormal CPU consumption; implement database-level resource quotas if available.

Threat Intelligence Overview

EPSS Score
0.3%
Top 79% exploitable
Prevalence
Low
emerging multi-model database, limited production footprint versus mainstream databases
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

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 0.3%
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
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

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

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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-134292 CRITICAL
9.3 Nov 21

SurrealDB versions 1.0.0 through 3.x (before 4.0.0) fail to enforce built-in function capability checks inside the embed

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-134299 HIGH
8.7 Nov 21

Memory exhaustion in SurrealDB 3.0.4 through 3.x lets unauthenticated remote clients pin up to 64 MiB of in-flight WebSo

CVE-2026-134293 HIGH
8.8 Nov 21

SQL injection in the Model Context Protocol (MCP) server component of SurrealDB 3.1.0 through 3.x (fixed in 4.0.0) allow

CVE-2026-134295 HIGH
8.7 Nov 21

Authenticated tenants of SurrealDB 3.0.0 through 3.x can escape key-based ACL boundaries in direct filesystem buckets an

CVE-2026-134291 HIGH
8.7 Nov 21

Filesystem bucket path traversal in SurrealDB 3.0.0 before 4.0.0 allows an attacker with bucket-operation access to read

CVE-2026-137490 HIGH
8.7 Nov 26

SurrealDB releases before 4.0.0 fail to check query capability inside the embedded JavaScript bridge, so a low-privilege

CVE-2026-134309 HIGH
8.7 Nov 21

SurrealDB 1.0.0 through 3.x lets an authenticated user with only the database-level VIEWER role read, modify, and delete

CVE-2026-121417 HIGH
8.8 Nov 03

Use-after-free in SurrealDB Core before 3.3.0 can crash or corrupt memory in Rust applications that embed the database a

CVE-2026-134294 HIGH
8.7 Nov 21

Cross-bucket file disclosure and modification on Windows affects SurrealDB versions 3.0.0 up to but not including 4.0.0

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

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