ZeroHour

CVE-2026-63735

niche

Cross-tenant access control bypass in SurrealDB custom API routes

CVSS 4.0
8.6 high
EPSS
<1%p30
Published
()
Modified
AI analysis

SurrealDB versions prior to 3.2.0 fail to validate the namespace/database named in custom API requests, allowing an authenticated user scoped to one tenant to invoke another tenant's `DEFINE API` endpoint by simply naming the victim scope in the `/api/{namespace}/{database}/{endpoint}` URL path (or via the `surreal-ns`/`surreal-db` headers or `USE` when calling `api::invoke()`). Because the request path overwrote the caller's session scope without checking it against the caller's authenticated level, and custom API handlers run with permissions disabled (definer's rights), the endpoint's own `PERMISSIONS` clause was the only remaining gate. An attacker with valid credentials for any namespace/database — even a `VIEWER` — can read data returned by a cross-tenant endpoint (including from `PERMISSIONS NONE` tables) or trigger its writes and side effects on a `PERMISSIONS FULL` endpoint. Only multi-tenant shared deployments whose callers hold non-root credentials and that define custom APIs are affected; single-tenant deployments, root-scope callers, and unauthenticated access are not impacted. No public proof-of-concept or known exploitation exists (EPSS 0.4%, not in CISA KEV).

What to do: Upgrade to SurrealDB 3.2.0 or later, where the requested namespace/database is validated against the caller's authenticated level and cross-tenant requests are rejected with 403. If patching is not immediately possible, disable the custom API HTTP route via capabilities where it is not required, avoid treating namespace/database boundaries as the tenant isolation boundary on shared instances, and prefer `PERMISSIONS WHERE` clauses keyed on the authenticated identity over `PERMISSIONS FULL`. Administrators of multi-tenant instances should audit defined endpoints for `PERMISSIONS FULL`/`PERMISSIONS NONE` settings and review logs for cross-namespace API invocations.

Affected
SurrealDBall versions prior to 3.2.0 (3.2.0 and later are not affected)
Estimated exposure
nicheunknown, plausibly low thousands to tens of thousands of deployments; only multi-tenant instances using DEFINE API with non-root authenticated callers are… — SurrealDB is a niche open-source Rust database with a modest installed base of self-hosted and cloud deployments, and the flaw only matters for the subset of multi-tenant shared instances that define custom APIs and serve non-root tenant…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

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.

Vendors
surrealdb
Products
surrealdb
Ecosystems
rust
Weakness
CWE-639
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
GHSA
GHSA-848m-r628-vrxw (high)

In the news

No ingested article mentions this CVE yet.