PatchSiren

PatchSiren cyber security CVE debrief

CVE-2025-71397 surrealdb CVE debrief

CVE-2025-71397 is a high-severity vulnerability in SurrealDB that allows authenticated users with OWNER or EDITOR permissions to define custom database functions via DEFINE FUNCTION using nested FOR loops. Although a single loop's iteration count is constrained, nesting multiple loops is not, enabling an attacker to execute a function that consumes all server CPU time. This can render the server unresponsive to other queries and connections until it is manually restarted. The vulnerability affects SurrealDB versions before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2.

Vendor
surrealdb
Product
Unknown
CVSS
HIGH 7.1
CISA KEV
Not listed in stored evidence
Original CVE published
2026-07-18
Original CVE updated
2026-07-18
Advisory published
2026-07-18
Advisory updated
2026-07-18

Who should care

Users of SurrealDB versions before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 should be aware of this vulnerability and take immediate action to mitigate the risk. This includes administrators, security teams, and operators who manage SurrealDB deployments, as well as developers who integrate SurrealDB into their applications. Affected users should prioritize patching or mitigating the vulnerability to prevent potential attacks.

Technical summary

The vulnerability exists in SurrealDB's handling of custom database functions defined using DEFINE FUNCTION with nested FOR loops. An attacker with OWNER or EDITOR permissions can exploit this vulnerability to execute a function that consumes all server CPU time, rendering the server unresponsive to other queries and connections. This affects SurrealDB versions before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2. The issue arises from the lack of constraints on nested loop iterations, allowing an attacker to cause a denial-of-service (DoS) condition. Configured timeouts do not stop the execution, further exacerbating the problem.

Defensive priority

High

Recommended defensive actions

  • Update SurrealDB to version 2.0.5, 2.1.5, or 2.2.2, or later
  • Restrict permissions to prevent users from defining custom database functions
  • Implement monitoring to detect potential exploitation attempts
  • Configure timeouts to limit the execution time of custom functions
  • Review compensating controls for exposed systems while remediation is scheduled and verified
  • Check relevant monitoring, detection, and logs for exposed assets that need extra review
  • Track exceptions, retest remediated assets, and close the item only after evidence is documented

Evidence notes

The CVE record was published on 2026-07-18T14:17:11.220Z and has not been modified since then. The NVD entry is currently in the 'Received' state. This information is based on the supplied source corpus and may not reflect the current state of the vulnerability. Users should verify the information with the official CVE record and NVD entry for the most up-to-date details.

Official resources

AI-assisted PatchSiren debrief based on the supplied source corpus. The CVE record was published on 2026-07-18T14:17:11.220Z and has not been modified since then. The NVD entry is currently in the 'Received' state.