{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2025-71397","id":"CVE-2025-71397","title":"SurrealDB before 2.2.2 CPU Exhaustion via nested FOR loops","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 exe","descriptionLong":"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.","published":"2026-07-18T13:10:15.129Z","updated":"2026-10-31T02:30:56.624241325Z","reserved":"2026-07-16T12:14:41.770Z","status":"Analyzed","rejected":false,"assigner":"VulnCheck","metric":{"version":"4.0","score":7.1,"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","rating":"high","source":"VulnCheck"},"metrics":[{"version":"4.0","score":7.1,"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","rating":"high","source":"VulnCheck"},{"version":"4.0","score":7.1,"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","rating":"high","source":"vulncheck.com"},{"version":"4.0","score":null,"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","rating":"unrated","source":"OSV"},{"version":"4.0","score":null,"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","rating":"high","source":"GitHub"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"}],"rating":"high","products":["surrealdb"],"affectedProducts":[{"vendor":"surrealdb","product":"surrealdb","defaultStatus":"unaffected","versions":[{"version":"2.2.0","status":"affected","versionType":"semver","lessThan":"2.2.2"},{"version":"2.2.2","status":"unaffected","versionType":"semver"}],"platforms":[]},{"vendor":"surrealdb","product":"surrealdb","defaultStatus":"unaffected","versions":[{"version":"2.1.0","status":"affected","versionType":"semver","lessThan":"2.1.5"},{"version":"2.1.5","status":"unaffected","versionType":"semver"}],"platforms":[]},{"vendor":"surrealdb","product":"surrealdb","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","versionType":"semver","lessThan":"2.0.5"},{"version":"2.0.5","status":"unaffected","versionType":"semver"}],"platforms":[]}],"packages":[{"ecosystem":"crates.io","name":"surrealdb","purl":"pkg:cargo/surrealdb","ranges":[">=2.2.0 <2.2.2",">=2.1.0 <2.1.5","<2.0.5"],"fixed":["2.2.2","2.1.5","2.0.5"],"advisory":"GHSA-pxw4-94j3-v9pf"}],"cwes":["CWE-835"],"aliases":["GHSA-pxw4-94j3-v9pf"],"references":[{"url":"https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pxw4-94j3-v9pf","tags":["vendor-advisory","Vendor Advisory","advisory","web"]},{"url":"https://www.vulncheck.com/advisories/surrealdb-before-cpu-exhaustion-via-nested-for-loops","tags":["third-party-advisory","Third Party Advisory","advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/71xxx/CVE-2025-71397.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71397","tags":["advisory"]},{"url":"https://github.com/surrealdb/surrealdb/pull/5597","tags":["web"]},{"url":"https://github.com/surrealdb/surrealdb","tags":["package"]}],"patchReferenced":false,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00551,"epssPercentile":0.46959,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2025-71397","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71397","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2025-71397","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-pxw4-94j3-v9pf","ok":true,"note":"GHSA-pxw4-94j3-v9pf"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2025-71397","ok":true,"note":"scored 2026-11-20"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}