GHSA-3V2X-9XCV-2V2V

GHSA-3V2X-9XCV-2V2V is a high-severity security vulnerability in surrealdb (rust), affecting versions < 2.5.0. It is fixed in 2.5.0, 3.0.0-beta.3.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

SurrealDB Affected by Confused Deputy Privilege Escalation through Future Fields and Functions

Unprivileged users (for example, those with the database editor role) can create or modify fields in records that contain functions or futures. Futures are values which are only computed when the value is queried. The query executes in the context of the querying user, rather than the user who originally defined the future. Likewise, fields containing functions or custom-defined logic (closures) are executed under the privileges of the invoking user, not the creator.

This results in a confused deputy vulnerability: an attacker with limited privileges can define a malicious function or future field that performs privileged actions. When a higher-privileged user (such as a root owner or namespace administrator) executes the function or queries or modifies that record, the function executes with their elevated permissions.

Workarounds

Users unable to patch are advised to evaluate their use of the database to identify where low privileged users are able to define logic subsequently executed by privileged users, such as apis, functions, futures fields and events, and recommended to minimise these instances.

References

Futures
Closures
SurrealDB Environment Variables

Impact

An attacker who can create or update function/future fields can plant logic that executes with a privileged user’s context. If a privileged user performs a write that touches the malicious field, the attacker can achieve full privilege escalation (e.g., create a root owner and take over the server).

If a privileged user performs a read action on the malicious field, this attack vector could still be potentially be used to perform limited denial of service or, in the specific case where the network capability was explicitly enabled and unrestricted, exfiltrate database information over the network.

Affected versions

surrealdb (< 2.5.0) surrealdb (>= 3.0.0-alpha.1, < 3.0.0-beta.3)

Security releases

surrealdb → 2.5.0 (rust) surrealdb → 3.0.0-beta.3 (rust)

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

Versions prior to 2.5.0 and 3.0.0-beta.3 are vulnerable.

For SurrealDB 3.0, futures are no longer supported, replaced by computed fields, only available within schemaful tables.

Further to this patches for 2.5.0 and 3.0.0-beta.3:

  • Implements an auth_limit on defined apis, functions, fields and events, that limits execution to the permissions of the creating user or the invoking user, whichever is lower.
  • Prevents closures from being stored, that eliminates a potential attack surface. For 2.5.0 this can still be allowed by using the insecure_storable_closures capability
  • Ensures the proper auth level is used to compute expressions in signin & signup

For existing apis, events, fields and functions defined prior to upgrading to 2.5.0 or 3.0.0-beta.3 auth_limit will not apply, to avoid breaking changes. These will need to subsequently be redefined so that auth_limit can take effect.

Frequently Asked Questions

  1. What is GHSA-3V2X-9XCV-2V2V? GHSA-3V2X-9XCV-2V2V is a high-severity security vulnerability in surrealdb (rust), affecting versions < 2.5.0. It is fixed in 2.5.0, 3.0.0-beta.3.
  2. Which versions of surrealdb are affected by GHSA-3V2X-9XCV-2V2V? surrealdb (rust) versions < 2.5.0 is affected.
  3. Is there a fix for GHSA-3V2X-9XCV-2V2V? Yes. GHSA-3V2X-9XCV-2V2V is fixed in 2.5.0, 3.0.0-beta.3. Upgrade to this version or later.
  4. Is GHSA-3V2X-9XCV-2V2V exploitable, and should I be worried? Whether GHSA-3V2X-9XCV-2V2V 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
  5. What actually determines whether GHSA-3V2X-9XCV-2V2V 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.
  6. How do I fix GHSA-3V2X-9XCV-2V2V?
    • Upgrade surrealdb to 2.5.0 or later
    • Upgrade surrealdb to 3.0.0-beta.3 or later

Other vulnerabilities in surrealdb

Stop the waste.
Protect your environment with Kodem.