/

CVE-2026-63735

Severity:

HIGH RISK

(8.1)

Improper Access Control (CWE-639) in SurrealDB APIs

CVE-2026-63735

Analyzed

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-639

Impact:

Cross-tenant data access and unauthorized operations

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SurrealDB custom API routes before version 3.2.0 do not properly validate the namespace and database scope, allowing authenticated users to call endpoints across tenants.

An attacker with credentials for any namespace or database can craft URLs that target other tenants' scopes, potentially reading sensitive data or triggering unintended operations in those contexts.

Affected context

This vulnerability appears in SurrealDB deployments that expose custom API routes and rely on URL path parameters to determine namespace and database scope.

It is relevant where multiple tenants, applications, or environments share the same SurrealDB instance, and access control is expected to isolate namespaces and databases from one another.

The issue is most pronounced when applications assume that authenticated credentials are automatically confined to their own namespace and database, without explicit server-side validation of the requested scope.

Exploit preconditions

  • Attack surface: SurrealDB HTTP API endpoints, specifically custom routes that accept namespace and database in the URL path.
  • Required access: Valid credentials for any namespace or database on the affected SurrealDB instance.
  • Trigger point: Issuing HTTP requests to custom API routes with manipulated URL path segments pointing to a different namespace or database.
  • Why exploitation is possible: The server-side logic authorizes requests based only on authentication, without sufficiently enforcing that the requested namespace/database matches the caller's permitted scope, leading to horizontal authorization bypass (CWE-639).

Why this happens

The underlying issue is an authorization design flaw where the system trusts client-supplied scope identifiers (namespace and database) in the request path without binding them to the authenticated principal's allowed context.

Instead of verifying that the namespace/database being accessed is permitted for the current credentials, the API routes accept any valid scope string and process the request.

This maps to CWE-639: Authorization Bypass Through User-Controlled Key, where identifiers used to select resources or tenants are not validated against the user's authorization profile, enabling cross-tenant or cross-account access.

Potential impact

  • Authenticated users may read sensitive data from other tenants' namespaces or databases.
  • Attackers could trigger write or update operations in foreign scopes, altering or corrupting data.
  • Cross-tenant information disclosure can undermine data isolation guarantees and compliance commitments.
  • Misuse of management or administrative custom routes could lead to broader configuration or operational impact.

General mitigation guidance

Effective mitigation focuses on enforcing strict authorization checks around scope identifiers and reducing reliance on client-controlled keys for access decisions.

Common defensive patterns include:

  • Binding authentication tokens or sessions to a specific namespace/database and rejecting requests that attempt to operate outside that bound scope.
  • Implementing server-side authorization middleware that validates namespace and database parameters against the caller's allowed set before executing any custom API route logic.
  • Avoiding direct trust of URL path segments or request parameters as the sole determinant of tenant or database selection; instead, derive scope from trusted authentication context.
  • Applying least-privilege principles so that credentials are limited to only the required scopes and cannot be reused for broader cross-tenant access.

How teams detect issues like this

Detection typically involves a mix of code-level and runtime analysis:

  • Reviewing custom route handlers and middleware for missing or insufficient authorization checks on namespace and database parameters.
  • Using static analysis or policy-based code scanning to flag patterns where user-controlled identifiers (e.g., path parameters) are used to select tenant or database without corresponding permission verification.
  • Analyzing logs for unusual patterns where a single principal accesses multiple namespaces/databases, especially across tenant boundaries.
  • Incorporating automated security review tools in CI/CD pipelines to enforce rules around multi-tenant isolation and scope validation for new or modified API routes.

Sources

SourceLink
github.comgithub.com/surrealdb/surrealdb/security/advisories/GHSA-848m-r628-vrxw
vulncheck.comvulncheck.com/advisories/surrealdb-before-authentication-bypass-via-custom-api

Frequently asked

questions

No. Exploitation requires valid credentials for at least one namespace or database. However, once authenticated, a user may access other scopes if the API does not enforce proper authorization checks.

The attacker must be an authenticated user of the SurrealDB instance with the ability to call custom API routes. They do not need any special administrative privileges, only a standard account in any namespace/database.

The most robust fix is to enforce server-side authorization that binds users to specific scopes and validates every requested namespace/database against an access control policy before executing route logic. Scope selection should originate from trusted authentication context, not unvalidated client input.

Design APIs with multi-tenant isolation in mind, consistently validate all identifiers used for resource or tenant selection, and use centralized authorization middleware. Combine these patterns with security-focused code reviews and automated checks that flag routes using user-controlled keys without explicit permission verification.

Find out what's already
exploitable in your codebase.