CVE-2025-71396
JSON

2.3low

SurrealDB before 2.2.2 Denial of Service via JavaScript Scripting

Severity
2.3low CVSS:4.0 by VulnCheck
Exploit likelihood
0.41% (higher than 37% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck
Also known as
GHSA-3824-qmfq-2qv7

Description

SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 does not enforce a default execution-time limit on embedded JavaScript scripting functions when the scripting capability is explicitly enabled (via --allow-scripting or --allow-all). An authenticated attacker can submit long-running JavaScript functions to exhaust server resources and cause a denial of service. Scripting is disabled by default.

Affected

Product or packageVersionsReported by
surrealdb surrealdbfrom 2.2.0 before 2.2.2, before 2.0.5, from 2.1.0 before 2.1.5
Not affected: 2.2.2, 2.0.5, 2.1.5
CVE List, NVD
surrealdb (crates.io)from 2.2.0 before 2.2.2, before 2.0.5, from 2.1.0 before 2.1.5GitHub Advisory Database

All scores

VulnCheck2.3low CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
GitHublow CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-770

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 does not enforce a default execution-time limit on embedded JavaScript scripting functions when the scripting capability is explicitly enabled (via --allow-scripting or --allow-all). An authenticated attacker can submit long-running JavaScript functions to exhaust server resources and cause a denial of service. Scripting is disabled by default.

GitHub Advisory Database

Through enabling the scripting capability. SurrealDB allows for advanced functions with complicated logic, by allowing embedded functions to be written in JavaScript.

These functions are bounded for memory and stack size, but not in time. An attacker could launch a number of long running functions that could potentially facilitate a Denial Of Service attack.

This vulnerability can only affect SurrealDB servers explicitly enabling the scripting capability with --allow-scripting or --allow-all and equivalent environment variables SURREAL_CAPS_ALLOW_SCRIPT=true and SURREAL_CAPS_ALLOW_ALL=true.

This issue was discovered and patched during an code audit and penetration test of SurrealDB by cure53, the severity defined within cure53's preliminary finding is Low, matched by our CVSS v4 assessment.

Impact

An attacker can use the scripting capabilities of SurrealDB to run a series of long running functions to facilitate a Denial Of Service attack.

Patches

A default timeout for the scripting functions has been implemented with a configurable SURREAL_SCRIPTING_MAX_TIME_LIMIT environment variable

  • Versions 2.0.5, 2.1.5, 2.2.2 and later are not affected by this issue.
Workarounds

For users that cannot upgrade. Deny execution of embedded scripting functions through the configuration of capabilities by starting SurrealDB with the --deny-scripting flag or the equivalent environment variable SURREAL_CAPS_DENY_SCRIPT=true. This has a usability implication, although scripting functions are disabled by default.

References

5597 SurrealDB Documentation - Capabilities SurrealQL Documentation - Scripting Functions

NVD (es)

SurrealDB antes de 2.0.5, 2.1.x antes de 2.1.5, y 2.2.x antes de 2.2.2 no impone un límite de tiempo de ejecución predeterminado en las funciones de scripting JavaScript incrustadas cuando la capacidad de scripting está explícitamente habilitada (mediante --allow-scripting o --allow-all). Un atacante autenticado puede enviar funciones JavaScript de larga duración para agotar los recursos del servidor y causar una denegación de servicio. El scripting está deshabilitado por defecto.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-71396 changed 2026-10-29CVE Terms of Use
GitHub Advisory DatabaseGHSA-3824-qmfq-2qv7 changed 2026-07-19CC-BY-4.0
NVDCVE-2025-71396 changed 2026-10-29Public domain