CVE-2025-71397

HIGH

SurrealDB before 2.2.2 CPU Exhaustion via nested FOR loops

Title source: cna
STIX 2.1

Description

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.

References (2)

Core 2
Core References
Vendor Advisory vendor-advisory
GitHub Security Advisory (GHSA-pxw4-94j3-v9pf)
https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pxw4-94j3-v9pf
Third Party Advisory third-party-advisory
VulnCheck Advisory: SurrealDB before 2.2.2 CPU Exhaustion via nested FOR loops
https://www.vulncheck.com/advisories/surrealdb-before-cpu-exhaustion-via-nested-for-loops

Scores

CVSS v4 7.1
EPSS 0.0029
EPSS Percentile 20.9%
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

CISA SSVC

Vulnrichment
Exploitation none
Automatable no
Technical Impact partial

Details

CWE
CWE-835
Status published
Products (6)
surrealdb/surrealdb < 2.0.5
surrealdb/surrealdb < 2.1.5
surrealdb/surrealdb < 2.2.2
surrealdb/surrealdb 2.0.5
surrealdb/surrealdb 2.1.5
surrealdb/surrealdb 2.2.2
Published Jul 18, 2026
Tracked Since Jul 18, 2026