/

CVE-2026-134292

Severity:

CRITICAL RISK

(9.8)

Authorization Bypass (CWE-862) in SurrealDB JS Bridge

CVE-2026-134292

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-862

Impact:

Unauthorized access to built-in functions

Severity:

CRITICAL RISK

(9.8)

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 embedded JavaScript bridge can bypass function capability checks when it dispatches built-in functions. An authenticated user who cannot call a built-in function through SurrealQL may still be able to invoke it through surrealdb.functions when embedded JavaScript is available.

Affected context

The issue affects SurrealDB deployments in the affected version range that expose embedded JavaScript scripting. The surrealdb.functions bridge dispatches calls to internal synchronous and asynchronous function handlers without applying the capability checks used for direct SurrealQL calls. As a result, restrictions on built-in functions may not hold across this alternate call path.

Exploit preconditions

  • Attack surface: SurrealDB embedded JavaScript scripting and its surrealdb.functions bridge
  • Required access: An authenticated account able to submit queries that invoke embedded JavaScript
  • Trigger point: A call to a built-in function through the JavaScript bridge
  • Why exploitation is possible: The bridge reaches internal function dispatchers without enforcing the relevant function capability checks

Why this happens

The underlying issue is a missing authorization check on an alternate function-dispatch path. Although SurrealQL capability controls can deny access to built-in functions, the JavaScript bridge invokes internal synchronous and asynchronous dispatchers without applying equivalent checks. This is an authorization enforcement failure mapped to CWE-862: Missing Authorization.

Potential impact

  • Authenticated users may invoke built-in functions that their capabilities are meant to restrict.
  • Depending on the functions available and the deployment configuration, this may expose protected operations or data.
  • The bypass could undermine capability-based access controls and increase the impact of a compromised or over-permissioned account.

General mitigation guidance

Defensive patterns include enforcing authorization consistently at the shared function-dispatch boundary, regardless of which interface invokes a function. Apply deny-by-default capability checks to every call path, limit accounts to the minimum required permissions, and disable embedded JavaScript where it is not needed. Treat alternate language bridges and plugin interfaces as security boundaries that require the same policy enforcement as direct queries.

How teams detect issues like this

Review function-dispatch paths for calls that bypass centralized authorization or capability checks. Static analysis and code review can look for bridge APIs that reach internal handlers directly, and tests can verify that denied functions remain unavailable through every supported interface. Policy checks may also flag deployments that enable embedded scripting for users or workloads that do not require it.

Sources

SourceLink
github.comgithub.com/surrealdb/surrealdb/security/advisories/GHSA-5w6j-qm42-4rc2
vulncheck.comvulncheck.com/advisories/surrealdb-1.0.0-before-4.0.0-function-capability-bypass-via-javascript-built-in-bridge

Frequently asked

questions

An authenticated user who can invoke embedded JavaScript in a vulnerable deployment may be able to call built-in functions denied to them through SurrealQL.

The described bypass requires authenticated query access and the ability to reach the embedded JavaScript bridge. Whether that access is available remotely depends on the deployment's network and query-access controls.

Enforce capability checks consistently at the shared function-dispatch boundary, including calls made through language bridges.

Test authorization rules across every interface that can invoke protected operations, use deny-by-default policies, and minimize access to embedded scripting features.

Find out what's already
exploitable in your codebase.