/

CVE-2026-121416

Severity:

HIGH RISK

(7.1)

Authorization Bypass (CWE-284) in SurrealDB Streaming Engine

CVE-2026-121416

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-284

Impact:

Unauthorized access to restricted functions and file bucket data

Severity:

HIGH RISK

(7.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's streaming engine does not consistently apply --deny-funcs restrictions to functions invoked using method-style syntax. An authenticated user who can submit queries may be able to call denied functions this way, including functions that read or write file bucket data.

SurrealDB's streaming engine does not consistently apply --deny-funcs restrictions to functions invoked using method-style syntax. An authenticated user who can submit queries may be able to call denied functions this way, including functions that read or write file bucket data.

Affected context

The issue occurs in SurrealDB's streaming engine when it evaluates method-style function calls. The affected behavior is described for SurrealDB 2.0.0 before 3.3.1, where resolved functions invoked through this syntax may not undergo the expected capability check.

The issue occurs in SurrealDB's streaming engine when it evaluates method-style function calls. The affected behavior is described for SurrealDB 2.0.0 before 3.3.1, where resolved functions invoked through this syntax may not undergo the expected capability check.

Exploit preconditions

  • Attack surface: Query execution in the streaming engine
  • Required access: An authenticated account able to submit queries
  • Trigger point: Evaluation of a method-style function call
  • Why exploitation is possible: The method evaluation path may invoke a resolved function without checking whether it is denied by the configured function restrictions
  • Attack surface: Query execution in the streaming engine
  • Required access: An authenticated account able to submit queries
  • Trigger point: Evaluation of a method-style function call
  • Why exploitation is possible: The method evaluation path may invoke a resolved function without checking whether it is denied by the configured function restrictions

Why this happens

The streaming engine's method-call evaluation path does not consistently enforce function capabilities. This is an authorization enforcement failure that maps to CWE-284: Improper Access Control: a restriction applied to function calls is bypassed when the same function is reached through a different invocation path.

The streaming engine's method-call evaluation path does not consistently enforce function capabilities. This is an authorization enforcement failure that maps to CWE-284: Improper Access Control: a restriction applied to function calls is bypassed when the same function is reached through a different invocation path.

Potential impact

  • Authenticated users may call functions that administrators intended to deny
  • Users may be able to read file bucket data through restricted functions
  • Users may be able to write or modify file bucket data
  • Applications relying on function denials for access control could expose sensitive data or operations
  • Authenticated users may call functions that administrators intended to deny
  • Users may be able to read file bucket data through restricted functions
  • Users may be able to write or modify file bucket data
  • Applications relying on function denials for access control could expose sensitive data or operations

General mitigation guidance

Defensive patterns focus on enforcing authorization consistently across every function invocation path.

  • Apply capability checks after function resolution and before execution, regardless of call syntax.
  • Use secure-by-default function policies and explicitly allow only the functions required by each workload.
  • Reduce trust in user-submitted queries by limiting who can submit them and constraining permitted query operations.
  • Keep query execution identities and file bucket permissions limited to the minimum required.
  • Treat function restrictions as one layer of defense, not a substitute for underlying data access controls.

Defensive patterns focus on enforcing authorization consistently across every function invocation path.

  • Apply capability checks after function resolution and before execution, regardless of call syntax.
  • Use secure-by-default function policies and explicitly allow only the functions required by each workload.
  • Reduce trust in user-submitted queries by limiting who can submit them and constraining permitted query operations.
  • Keep query execution identities and file bucket permissions limited to the minimum required.
  • Treat function restrictions as one layer of defense, not a substitute for underlying data access controls.

How teams detect issues like this

  • Review function evaluation paths to confirm that capability checks apply equally to direct and method-style calls.
  • Use static analysis or code review checks to identify function invocation paths that bypass centralized authorization.
  • Test policy enforcement with representative call forms, including method-style calls, and verify that denied operations remain blocked.
  • Monitor query activity for restricted function usage and unexpected file bucket reads or writes.
  • Enforce query and function policies through centralized authorization controls and automated security checks.
  • Review function evaluation paths to confirm that capability checks apply equally to direct and method-style calls.
  • Use static analysis or code review checks to identify function invocation paths that bypass centralized authorization.
  • Test policy enforcement with representative call forms, including method-style calls, and verify that denied operations remain blocked.
  • Monitor query activity for restricted function usage and unexpected file bucket reads or writes.
  • Enforce query and function policies through centralized authorization controls and automated security checks.

Sources

SourceLink
github.comgithub.com/surrealdb/surrealdb/security/advisories/GHSA-p296-7pr4-87rr
vulncheck.comvulncheck.com/advisories/surrealdb-2.0.0-before-3.3.1-deny-funcs-capability-bypass-via-method-style-invocations

Frequently asked

questions

Exploitation depends on whether an attacker can submit queries to the affected SurrealDB streaming engine. Query access may be available over a network, but the description requires an authenticated user.

The attacker needs an authenticated account with permission to submit queries. The issue concerns bypassing function restrictions, not obtaining initial access.

Enforce capability checks for every resolved function before execution, independent of whether it was called directly or through method syntax. Also restrict the underlying data permissions available to query execution.

Centralize authorization checks and test them across all supported invocation forms. Use least-privilege accounts and monitor for attempts to invoke restricted functions.

Exploitation depends on whether an attacker can submit queries to the affected SurrealDB streaming engine. Query access may be available over a network, but the description requires an authenticated user.

The attacker needs an authenticated account with permission to submit queries. The issue concerns bypassing function restrictions, not obtaining initial access.

Enforce capability checks for every resolved function before execution, independent of whether it was called directly or through method syntax. Also restrict the underlying data permissions available to query execution.

Centralize authorization checks and test them across all supported invocation forms. Use least-privilege accounts and monitor for attempts to invoke restricted functions.

Find out what's already
exploitable in your codebase.