Summary
SurrealDB no JavaScript script function default timeout could facilitate DoS
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.
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
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.
The application allocates resources such as memory, threads, or file descriptors based on untrusted input without enforcing a cap. Typical impact: resource exhaustion leading to denial of service.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
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.
Frequently Asked Questions
- What is GHSA-3824-QMFQ-2QV7? GHSA-3824-QMFQ-2QV7 is a low-severity allocation of resources without limits or throttling vulnerability in surrealdb (rust), affecting versions >= 2.2.0, < 2.2.2. It is fixed in 2.2.2, 2.0.5, 2.1.5. The application allocates resources such as memory, threads, or file descriptors based on untrusted input without enforcing a cap.
- Which versions of surrealdb are affected by GHSA-3824-QMFQ-2QV7? surrealdb (rust) versions >= 2.2.0, < 2.2.2 is affected.
- Is there a fix for GHSA-3824-QMFQ-2QV7? Yes. GHSA-3824-QMFQ-2QV7 is fixed in 2.2.2, 2.0.5, 2.1.5. Upgrade to this version or later.
- Is GHSA-3824-QMFQ-2QV7 exploitable, and should I be worried? Whether GHSA-3824-QMFQ-2QV7 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-3824-QMFQ-2QV7 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-3824-QMFQ-2QV7?
- Upgrade
surrealdbto 2.2.2 or later - Upgrade
surrealdbto 2.0.5 or later - Upgrade
surrealdbto 2.1.5 or later
- Upgrade