CVE-2025-71397
published high CVSS 4.0 · 7.1SurrealDB before 2.2.2 CPU Exhaustion via nested FOR loops
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| surrealdb | — | surrealdb2.2.0 to < 2.2.2 (affected · semver) · 2.2.2 (unaffected · semver) · Other versions: unaffected | Version-specific | Not stated | VulnCheck |
| surrealdb | — | surrealdb2.1.0 to < 2.1.5 (affected · semver) · 2.1.5 (unaffected · semver) · Other versions: unaffected | Version-specific | Not stated | VulnCheck |
| surrealdb | — | surrealdb0 to < 2.0.5 (affected · semver) · 2.0.5 (unaffected · semver) · Other versions: unaffected | Version-specific | Not stated | VulnCheck |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 7.1 / 10
- Severity
- high
- Provider
- VulnCheck · cna
- Vector string
- 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
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| surrealdb | surrealdb | 2.2.0 to < 2.2.2 (affected · semver)2.2.2 (unaffected · semver)Default: unaffected | VulnCheck · cna |
| surrealdb | surrealdb | 2.1.0 to < 2.1.5 (affected · semver)2.1.5 (unaffected · semver)Default: unaffected | VulnCheck · cna |
| surrealdb | surrealdb | 0 to < 2.0.5 (affected · semver)2.0.5 (unaffected · semver)Default: unaffected | VulnCheck · cna |
Weaknesses
1- CWE-835 Loop with Unreachable Exit Condition ('Infinite Loop')
References
2- GitHub Security Advisory (GHSA-pxw4-94j3-v9pf) https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pxw4-94j3-v9pf
- 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
Provider assertions
2VulnCheck · cna
SurrealDB before 2.2.2 CPU Exhaustion via nested FOR loops
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- f88fd9b6ebee739e652178c33616d6cb1a2314686187d6ceb6b948c4e9842b01
- Ingested
- 29 Oct 2026, 21:17:51 UTC
- Source record
- Official CVE record