{"cve":"CVE-2025-71397","nvd":{"published":"2026-07-18T14:17:11.220","modified":"2026-10-29T21:17:06.450","status":"Analyzed","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.","cvss_v4":{"vector":"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","score":7.1},"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5},"cwes":["CWE-835"],"references":["https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pxw4-94j3-v9pf","https://www.vulncheck.com/advisories/surrealdb-before-cpu-exhaustion-via-nested-for-loops"],"products":["surrealdb:surrealdb"],"source":"nvd","synced_at":"2026-10-29T21:36:56.436249234+00:00"},"epss":{"cve":"CVE-2025-71397","score":0.00551,"percentile":0.4598,"date":"2026-10-29"},"kev":null,"osv":[{"id":"GHSA-pxw4-94j3-v9pf","url":"https://osv.dev/vulnerability/GHSA-pxw4-94j3-v9pf","summary":"SurrealDB CPU exhaustion via custom functions result in total DoS","modified":"2026-07-19T03:56:48.383534339Z","packages":[{"ecosystem":"crates.io","name":"surrealdb","purl":"pkg:cargo/surrealdb","ranges":[">=2.2.0 <2.2.2"],"fixed":["2.2.2"]},{"ecosystem":"crates.io","name":"surrealdb","purl":"pkg:cargo/surrealdb","ranges":[">=2.1.0 <2.1.5"],"fixed":["2.1.5"]},{"ecosystem":"crates.io","name":"surrealdb","purl":"pkg:cargo/surrealdb","ranges":["<2.0.5"],"fixed":["2.0.5"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}