CVE-2026-63735: SurrealDB: Custom API route lets authenticated callers override namespace/database scope via URL path
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…
Published Sep 4, 2026
Affected packages
surrealdb
- Ecosystem
- Rust (crates.io)
- Affected
- < 3.2.0
- Fixed in
- 3.2.0
- Check
cargo tree -i surrealdb
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
VIEWERis 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 NONEtables, 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 WHEREclause that checks the authenticated identity overPERMISSIONS 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.
Credited to sondt99.
References
- https://github.com/surrealdb/surrealdb/security/advisories/GHSA-848m-r628-vrxw
- https://nvd.nist.gov/vuln/detail/CVE-2026-63735
- https://github.com/surrealdb/surrealdb/commit/0938f88d196dc4eb11a82af343df3fffe9c195e2
- https://github.com/surrealdb/surrealdb/commit/75b7154f84904d047619b5a47b08d256254dceca
- https://www.vulncheck.com/advisories/surrealdb-before-authentication-bypass-via-custom-api
- https://github.com/advisories/GHSA-848m-r628-vrxw
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesCVE-2026-63740
SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users
medium6.5Aug 14, 2026CVE-2026-49997
SurrealDB: Edge PERMISSIONS FOR delete bypassed when a connected node is deleted
medium5.4Jul 1, 2026CVE-2026-63743
SurrealDB: Port-specific --deny-net rules silently bypassed on HTTP redirect
medium6.4Jul 1, 2026CVE-2026-63746
SurrealDB: Graph traversal bypasses table SELECT permissions
medium6.5Jul 1, 2026CVE-2026-63748
SurrealDB: Authenticated callers can read fields hidden by field-level SELECT permissions via error messages
medium4.3Jul 1, 2026CVE-2026-63751
SurrealDB has bypass of field-level SELECT permissions through JSON Patch `copy` and `move` with empty `from`
medium4.3Jul 1, 2026
