CVE-2026-63735: SurrealDB before 3.2.0 Authentication Bypass via Custom API
An authenticated user scoped to one namespace/database could invoke a custom API (DEFINE API) belonging to a different namespace/database, reaching another tenant's endpoint.
The route /api/{namespace}/{database}/{endpoint} took the namespace and database from the URL and applied them to the caller's session before the endpoint was looked up or run, without checking that the caller's authenticated scope covered them. Because a custom API handler runs with permissions disabled (definer's rights), the endpoint's own PERMISSIONS clause was the only gate — open to everyone for a PERMISSIONS FULL endpoint. The api::invoke() function was affected the same way, resolving against the session's selected namespace/database (settable via the surreal-ns / surreal-db headers or USE).
Impact
What an attacker can do:
- With valid credentials for any one namespace/database (a VIEWER is enough), invoke a custom API in another namespace/database by naming the victim scope in the URL. - Read data that endpoint returns — including from PERMISSIONS NONE tables, since the handler runs with permissions disabled — or trigger any writes and side effects it performs.
What it can't do:
- Reach a scope without valid credentials for some namespace/database on the instance; this is not an unauthenticated bypass. - Affect single-tenant deployments, or any deployment where callers already hold instance-wide (root) scope.
Patches
The namespace/database is now validated against the caller's authenticated level — which the request cannot change — before the endpoint is resolved or run. A target scope outside that level is rejected with 403 Forbidden, both at the HTTP entry point and at the dispatch step shared with api::invoke(). Root reaches any scope; namespace principals their namespace; database and record principals their exact namespace/database; anonymous callers remain governed by the endpoint's PERMISSIONS.
- Versions 3.2.0 and later are not affected by this issue.
Workarounds
Users unable to patch should consider the following workarounds:
- Disable the custom API HTTP route via capabilities where it is not required. - Treat separate deployments, not namespace/database boundaries, as the tenant isolation boundary on shared instances. - Prefer a PERMISSIONS WHERE clause that checks the authenticated identity over PERMISSIONS FULL (reduces exposure but does not restore the boundary).
Resources
- SurrealQL Documentation — DEFINE API - SurrealDB Documentation — Capabilities - fix(core/api): reject cross-tenant custom API access (included in SurrealDB 3.2.0)
Acknowledgements
SurrealDB thanks sondt99 for reporting this issue.
Other sources
SurrealDB versions before 3.2.0 fail to validate namespace and database scope in custom API routes, allowing authenticated users to invoke endpoints in different namespaces/databases. Attackers with valid credentials for any namespace/database can access custom API endpoints in other tenants by specifying the target scope in the URL path, reading sensitive data or triggering unintended operations.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rust/surrealdbto a version that resolves this vulnerability.Fixed in 3.2.0 - Upgrade
Upgrade
SurrealDBto a version that resolves this vulnerability.Fixed in 3.2.0Patch fix(core/api): reject cross-tenant custom API access - Configuration
If not required, disable the custom API HTTP route via capabilities so cross-tenant custom API access is not possible.
SurrealDB custom API HTTP route Disable the custom API HTTP route via capabilities = disabled - Compensating control
Use SurrealQL `PERMISSIONS WHERE` clauses that check the authenticated identity instead of `PERMISSIONS FULL` on custom APIs/handlers to reduce exposure (note: does not restore the boundary).
Event History
Frequently Asked Questions
What is the severity of CVE-2026-63735?
The severity of CVE-2026-63735 is rated as high, with a score of 8.6.
How do I fix CVE-2026-63735?
To fix CVE-2026-63735, upgrade SurrealDB to version 3.2.0 or later.
What vulnerability does CVE-2026-63735 address?
CVE-2026-63735 addresses an authentication bypass vulnerability in SurrealDB due to insufficient validation of namespace and database scope.
Who is affected by CVE-2026-63735?
Authenticated users of SurrealDB versions prior to 3.2.0 are affected by CVE-2026-63735.
What are the potential consequences of exploiting CVE-2026-63735?
Exploiting CVE-2026-63735 can allow attackers with valid credentials to access and invoke custom API endpoints across different namespaces and databases.