---
id: CVE-2025-71393
title: >-
  SurrealDB before 2.2.2 with scripting enabled fails to properly enforce
  recursion limits when native functions contain embedded JavaScript that issues
  new queries
summary: >-
  SurrealDB before 2.2.2 with scripting enabled fails to properly enforce
  recursion limits when native functions contain embedded JavaScript that issues
  new queries. Authenticated attackers can bypass the recursion limit by
  chaining native…
severity: medium
cvss: 6.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'
cwe:
  - CWE-674
vendor: surrealdb
product: surrealdb
affected:
  - surrealdb < 2.0.5
  - 'surrealdb >= 2.1.0, < 2.1.5'
  - 'surrealdb >= 2.2.0, < 2.2.2'
patched:
  - surrealdb 2.2.2
published: '2026-07-18'
updated: '2026-09-29'
sourceUpdated: '2026-09-29T19:10:00.160'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2025-71393'
references:
  - url: >-
      https://github.com/surrealdb/surrealdb/security/advisories/GHSA-m7rc-8w7m-r9qr
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/surrealdb-before-memory-exhaustion-via-nested-functions
    label: disclosure@vulncheck.com
tags:
  - nvd
  - cve.org
epss: 0.00461
epssPercentile: 0.3981
ingestedAt: '2026-07-19T05:29:21.214Z'
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-07-20T17:02:48.522453Z'
scores:
  nvd: 6.5
  cna: 6
---

## Overview

SurrealDB before 2.2.2 with scripting enabled fails to properly enforce recursion limits when native functions contain embedded JavaScript that issues new queries. Authenticated attackers can bypass the recursion limit by chaining native and JavaScript function calls to trigger infinite recursion and exhaust server memory.

## Affected

- `surrealdb < 2.0.5`
- `surrealdb >= 2.1.0, < 2.1.5`
- `surrealdb >= 2.2.0, < 2.2.2`

## Remediation

Upgrade past the affected range:

- `surrealdb 2.2.2`
