CVE-2025-71397: SurrealDB before 2.2.2 CPU Exhaustion via nested FOR loops

Published Jul 18, 2026
·
Updated

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.

Affected Software

6 affected components
SurrealDB SurrealDB<2.0.5
SurrealDB SurrealDB>2.1.0<=2.1.5
SurrealDB SurrealDB<2.2.2
SurrealDB SurrealDB<2.0.5
SurrealDB SurrealDB>=2.1.0<2.1.5
SurrealDB SurrealDB>=2.2.0<2.2.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade SurrealDB to a version that resolves this vulnerability.

    Fixed in 2.0.5
  2. Upgrade

    Upgrade SurrealDB to a version that resolves this vulnerability.

    Fixed in 2.1.5
  3. Upgrade

    Upgrade SurrealDB to a version that resolves this vulnerability.

    Fixed in 2.2.2
  4. Compensating control

    Restrict which authenticated users have OWNER or EDITOR permissions at the root, namespace, or database level, since those permissions allow defining custom database functions via DEFINE FUNCTION that contain nested FOR loops.

  5. Operational

    Because CPU exhaustion can render the server unresponsive until restarted, restart the SurrealDB server after mitigating the issue to restore availability.

Event History

Jul 18, 2026
CVE Published
via MITRE·01:10 PM
Data Sourced
via MITRE·01:10 PM
DescriptionWeakness
Data Sourced
via NVD·02:17 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-71397?

CVE-2025-71397 has a high severity rating of 7.1.

2

How do I fix CVE-2025-71397?

To fix CVE-2025-71397, upgrade SurrealDB to version 2.2.2 or later.

3

What type of vulnerability is CVE-2025-71397?

CVE-2025-71397 is a CPU exhaustion vulnerability caused by nested FOR loops in custom database functions.

4

Who is affected by CVE-2025-71397?

Authenticated users with OWNER or EDITOR permissions at the root, namespace, or database level are affected by CVE-2025-71397.

5

When was CVE-2025-71397 published?

CVE-2025-71397 was published on July 18, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203