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

- Severity: High 7.1 (CVSS:4.0, scored by VulnCheck) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.41%, higher than 37% of CVEs (2026-12-01)
- Published: 2025-04-11T14:09:14.000Z
- Modified: 2026-10-29T21:17:06.450Z
- Also known as: GHSA-pxw4-94j3-v9pf
- Weaknesses: CWE-835
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: VulnCheck

## 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.

(As written by CVE List.)

## Affected

- surrealdb surrealdb: from 2.2.0 before 2.2.2; from 2.1.0 before 2.1.5; before 2.0.5 (not affected: 2.2.2; 2.1.5; 2.0.5)
- surrealdb (crates.io): from 2.2.0 before 2.2.2; from 2.1.0 before 2.1.5; before 2.0.5

## Every score

- VulnCheck: CVSS:4.0 7.1 High `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`
- GitHub: CVSS:4.0 High `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`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/surrealdb/surrealdb/security/advisories/GHSA-pxw4-94j3-v9pf> (vendor-advisory, web)
- <https://www.vulncheck.com/advisories/surrealdb-before-cpu-exhaustion-via-nested-for-loops> (third-party-advisory)
- <https://github.com/surrealdb/surrealdb/pull/5597> (web)
- <https://github.com/surrealdb/surrealdb> (package)

## Sources

- CVE List: [CVE-2025-71397](https://www.cve.org/CVERecord?id=CVE-2025-71397), CVE Terms of Use, modified 2026-10-29
- GitHub Advisory Database: [GHSA-pxw4-94j3-v9pf](https://github.com/advisories/GHSA-pxw4-94j3-v9pf), CC-BY-4.0, modified 2026-07-19
- NVD: [CVE-2025-71397](https://nvd.nist.gov/vuln/detail/CVE-2025-71397), Public domain, modified 2026-10-29

---

Page: https://cve.day/CVE-2025-71397 · Whole record: https://cve.day/CVE-2025-71397.json · Rebuilt by cve.day 2026-11-25T22:59:12.405Z
