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,… (CVE-2025-71397)
SurrealDB versions before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 contain a vulnerability that allows authenticated users with OWNER or EDITOR permissions to define custom database functions using nested FOR loops. This can lead to excessive CPU consumption that is not stopped by configured timeouts, causing the server to become unresponsive until manually restarted.
AI Analysis
Technical Summary
SurrealDB versions prior to 2.0.5, 2.1.0 up to but not including 2.1.5, and 2.2.0 up to but not including 2.2.2 allow authenticated users with OWNER or EDITOR permissions at various levels (root, namespace, or database) to define custom functions via DEFINE FUNCTION that use nested FOR loops. While single loops have constrained iteration counts, nested loops can multiply iterations (e.g., multiple loops each with 1,000,000 iterations), resulting in CPU exhaustion. The configured execution timeouts do not interrupt this behavior, rendering the database server unresponsive to other queries and connections until a manual restart occurs.
Potential Impact
The vulnerability leads to a denial-of-service condition by exhausting server CPU resources, causing the SurrealDB server to become unresponsive. This impacts availability but does not affect confidentiality or integrity. The attack requires authenticated user privileges with OWNER or EDITOR roles.
Mitigation Recommendations
A fix is available in SurrealDB versions 2.0.5, 2.1.5, and 2.2.2. Users should upgrade to these or later versions to remediate the vulnerability. Until patched, restrict OWNER and EDITOR permissions carefully to trusted users only. Manual server restarts are required to recover from an attack. Patch status is confirmed by the version information provided; no additional vendor advisory was included.
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,… (CVE-2025-71397)
Description
SurrealDB versions before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 contain a vulnerability that allows authenticated users with OWNER or EDITOR permissions to define custom database functions using nested FOR loops. This can lead to excessive CPU consumption that is not stopped by configured timeouts, causing the server to become unresponsive until manually restarted.
CVSS v3.1
Score 6.5medium
Affected software
pkg:github/surrealdb/surrealdbRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
SurrealDB versions prior to 2.0.5, 2.1.0 up to but not including 2.1.5, and 2.2.0 up to but not including 2.2.2 allow authenticated users with OWNER or EDITOR permissions at various levels (root, namespace, or database) to define custom functions via DEFINE FUNCTION that use nested FOR loops. While single loops have constrained iteration counts, nested loops can multiply iterations (e.g., multiple loops each with 1,000,000 iterations), resulting in CPU exhaustion. The configured execution timeouts do not interrupt this behavior, rendering the database server unresponsive to other queries and connections until a manual restart occurs.
Potential Impact
The vulnerability leads to a denial-of-service condition by exhausting server CPU resources, causing the SurrealDB server to become unresponsive. This impacts availability but does not affect confidentiality or integrity. The attack requires authenticated user privileges with OWNER or EDITOR roles.
Mitigation Recommendations
A fix is available in SurrealDB versions 2.0.5, 2.1.5, and 2.2.2. Users should upgrade to these or later versions to remediate the vulnerability. Until patched, restrict OWNER and EDITOR permissions carefully to trusted users only. Manual server restarts are required to recover from an attack. Patch status is confirmed by the version information provided; no additional vendor advisory was included.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-33m9-4q46-9q55
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-71397"]
- Ecosystems
- []
- Database Specific Severity
- HIGH
- Cvss Version
- 4.0
Threat ID: 6a5ba17f44ab8fbf7c789e5b
Added to database: 07/18/2026, 15:53:35 UTC
Last enriched: 08/13/2026, 19:16:22 UTC
Last updated: 08/31/2026, 00:00:53 UTC
Views: 88
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.