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
| Link | Resource |
|---|---|
| https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pxw4-94j3-v9pf | Vendor Advisory |
| https://www.vulncheck.com/advisories/surrealdb-before-cpu-exhaustion-via-nested-for-loops | Third Party Advisory |
Configurations
Configuration 1 (hide)
|
History
29 Sep 2026, 19:10
| Type | Values Removed | Values Added |
|---|---|---|
| Summary |
|
13 Aug 2026, 13:44
| Type | Values Removed | Values Added |
|---|---|---|
| First Time |
Surrealdb
Surrealdb surrealdb |
|
| CPE | cpe:2.3:a:surrealdb:surrealdb:*:*:*:*:*:*:*:* | |
| References | () https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pxw4-94j3-v9pf - Vendor Advisory | |
| References | () https://www.vulncheck.com/advisories/surrealdb-before-cpu-exhaustion-via-nested-for-loops - Third Party Advisory | |
| CVSS |
v2 : v3 : |
v2 : unknown
v3 : 6.5 |
18 Jul 2026, 14:17
| Type | Values Removed | Values Added |
|---|---|---|
| New CVE |
Information
Published : 2026-07-18 14:17
Updated : 2026-10-29 21:17
NVD link : CVE-2025-71397
Mitre link : CVE-2025-71397
CVE.ORG link : CVE-2025-71397
JSON object : View
Products Affected
surrealdb
- surrealdb
CWE
CWE-835
Loop with Unreachable Exit Condition ('Infinite Loop')
