GHSA-3v2x-9xcv-2v2v CVE-2026-63763
SurrealDB Affected by Confused Deputy Privilege Escalation through Future Fields and Functions
- Severity
- 0.0 / 10
- High · CVSS 4.0
- Exploit chance (EPSS)
- 0.50%
- Chance of exploitation in the next 30 days. Higher than 42.61% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-441 Unintended Proxy or Intermediary ('Confused Deputy')
- Fix
2.5.0- Upgrade surrealdb to this version or later
Description
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.
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.
Patches
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_limiton defined apis, functions, fields and events, that limits execution to the permissions of the creating user or the invoking user, whichever is lower. - Prevents
closuresfrom being stored, that eliminates a potential attack surface. For 2.5.0 this can still be allowed by using theinsecure_storable_closurescapability - 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.
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
Affected versions
crates.io
| Package | Vulnerable | Fixed in |
|---|---|---|
| surrealdb | < 2.5.0 |
2.5.0 |
| surrealdb | >= 3.0.0-alpha.1, < 3.0.0-beta.3 |
3.0.0-beta.3 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
surrealdb crates.io → 2.5.0
- cargo
cargo update -p surrealdb --precise 2.5.0
Severity breakdown
CVSS 4.0 0.0
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
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- Present
- Privileges required
- Low
- User interaction
- Passive
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- High
- Availability (vulnerable system)
- High
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
CVSS 3.1 8.8
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Weakness
CWE-441: Unintended Proxy or Intermediary ('Confused Deputy')
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.
How to prevent it
- Architecture and Design: Enforce the use of strong mutual authentication mechanism between the two parties.
- Architecture and Design: Whenever a product is an intermediary or proxy for transactions between two other components, the proxy core should not drop the identity of the initiator of the transaction. The immutability of the identity of the initiator must be maintained and should be forwarded all the way to the target.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-8rw6-p7m8-63jp SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users | High | Also affects surrealdb |
| GHSA-848m-r628-vrxw SurrealDB: Custom API route lets authenticated callers override namespace/database scope via URL path | High | Also affects surrealdb |
| GHSA-m3c3-78fh-w3w7 SurrealDB allows bypass of deny-net flags via DNS resolution | High | Also affects SurrealDB |
| GHSA-whwg-vh4f-pmmf SurrealDB: Edge PERMISSIONS FOR delete bypassed when a connected node is deleted | Medium | Also affects surrealdb |
| GHSA-fwg2-gr34-q3w8 SurrealDB: ES512 silently downgraded to ES384 due to jsonwebtoken crate limitation | Medium | Also affects surrealdb |
| GHSA-c8jx-96c9-8xrp SurrealDB: Field-level SELECT permissions bypassed via indexed COUNT fast paths | Medium | Also affects surrealdb |
| GHSA-wp87-mgvq-5j93 SurrealDB: USE NS/DB implicit creation bypasses DEFINE authorization | Medium | Also affects surrealdb |
| GHSA-97vg-427p-8hx5 SurrealDB: Port-specific --deny-net rules silently bypassed on HTTP redirect | Medium | Also affects surrealdb |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor