GHSA-3v2x-9xcv-2v2v: Surrealdb SurrealDB Affected By Confused Deputy Vulnerability
HIGHGHSA-3v2x-9xcv-2v2v is a HIGH surrealdb affected by confused deputy vulnerability (CWE-441: Unintended Proxy or Intermediary ('Confused Deputy')) affecting Surrealdb libraries in the crates.io ecosystem. The issue involves surrealdb affected by confused deputy privilege escalation through future fields and functions. Remediation is available by upgrading affected packages to version 2.5.0, 3.0.0-beta.3.
GHSA-3v2x-9xcv-2v2v at a Glance
How to Fix GHSA-3v2x-9xcv-2v2v
To remediate this vulnerability, upgrade all affected Surrealdb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade surrealdb to 2.5.0
Upgrade surrealdb to 3.0.0-beta.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for surrealdb
How to Check if You Are Affected
To determine whether your application is affected by GHSA-3v2x-9xcv-2v2v, inspect your project dependencies for Surrealdb:
inspect dependencies for surrealdb
Analyze the terminal output to locate any version of Surrealdb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.5.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-441: Unintended Proxy or Intermediary ('Confused Deputy'), where the product receives a request, message, or directive from an upstream component, but the product does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the product's control sphere. this causes the product to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor. In Surrealdb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-3v2x-9xcv-2v2v Affected Surrealdb Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
surrealdb
|
crates.io |
< 2.5.0
|
2.5.0
|
|
surrealdb
|
crates.io |
≥ 3.0.0-alpha.1
< 3.0.0-beta.3
|
3.0.0-beta.3
|
References
Frequently Asked Questions
What is GHSA-3v2x-9xcv-2v2v?
Which Surrealdb versions are affected?
What version fixes GHSA-3v2x-9xcv-2v2v?
Is surrealdb affected?
What CWE is associated with GHSA-3v2x-9xcv-2v2v?
How can I check crates.io dependencies for GHSA-3v2x-9xcv-2v2v?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3v2x-9xcv-2v2v",
"modified" : "2026-01-29T03:45:36Z",
"published" : "2026-01-22T18:06:15Z",
"aliases" : [ ],
"summary" : "SurrealDB Affected by Confused Deputy Privilege Escalation through Future Fields and Functions",
"details" : "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.\n\nThis 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. \n\n### Impact\nAn 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). \n\nIf 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.\n\n### Patches\n\nVersions prior to 2.5.0 and 3.0.0-beta.3 are vulnerable.\n\nFor SurrealDB 3.0, `futures` are no longer supported, replaced by `computed` fields, only available within schemaful tables. \n\nFurther to this patches for 2.5.0 and 3.0.0-beta.3: \n- 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.\n- 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\n- Ensures the proper auth level is used to compute expressions in signin & signup\n\n**_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._**\n\n### Workarounds\nUsers 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.\n\n### References\n[Futures](https://surrealdb.com/docs/surrealql/datamodel/futures)\n[Closures](https://surrealdb.com/docs/surrealql/datamodel/closures)\n[SurrealDB Environment Variables](https://surrealdb.com/docs/surrealdb/cli/env)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.5.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0-alpha.1"
}, {
"fixed" : "3.0.0-beta.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-3v2x-9xcv-2v2v"
}, {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/commit/f515c91363ee735aa1bc08580d9e7fa0de6e736f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/surrealdb/surrealdb"
}, {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/releases/tag/v2.5.0"
}, {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/releases/tag/v3.0.0-beta.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-441" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-01-22T18:06:15Z",
"nvd_published_at" : null
}
}