CVE-2026-134292 in SurrealDB
Summary
by MITRE • 11/21/2026
SurrealDB 1.0.0 before 4.0.0 contains a capability check bypass in its embedded JavaScript scripting engine, where the surrealdb.functions bridge calls the internal fnc::synchronous() and fnc::asynchronous() dispatchers without enforcing function capability checks. Authenticated users denied access to built-in functions in SurrealQL can execute them by calling them through surrealdb.functions from embedded JavaScript.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/21/2026
The vulnerability identified in SurrealDB versions prior to 4.0.0 represents a critical authorization bypass within the database's embedded JavaScript scripting engine, specifically affecting the interaction between the SurrealQL query language and the internal function execution layer. This flaw stems from an improper implementation of access control mechanisms when bridging calls from the high-level SQL-like interface down to lower-level Rust-based functions. In a properly secured system, any request for functionality must undergo rigorous verification against the current user's permissions before execution proceeds. However, in this specific scenario, the surrealdb.functions bridge acts as an intermediary that invokes internal dispatchers such as fnc::synchronous() and fnc::asynchronous(). These dispatchers are responsible for routing requests to various built-in functions like mathematical operations, string manipulations, or cryptographic hashes. The core technical failure lies in the fact that these specific entry points do not re-evaluate or enforce the capability checks that were already performed at the SurrealQL level. This creates a logical gap where the security context established by the query parser is effectively discarded when control passes to the JavaScript bridge layer.
From an operational perspective, this flaw allows authenticated users who have been explicitly denied access to certain built-in functions via standard SurrealQL queries to bypass those restrictions entirely. By embedding JavaScript code within their database operations, these malicious actors can invoke restricted functionalities directly through the surrealdb.functions object. This circumvention is particularly dangerous because it undermines the principle of least privilege that underpins modern multi-tenant databases and application security models. An attacker with limited permissions could potentially access sensitive data processing capabilities, perform unauthorized cryptographic operations, or exploit side-channel effects associated with specific functions that are normally restricted to administrators or privileged roles. The impact extends beyond simple function execution; it compromises the integrity of the database's authorization model, allowing for potential escalation of privileges and further exploitation depending on what those restricted functions can achieve within the application context.
This vulnerability aligns closely with CWE-284, which describes Improper Access Control, as well as CWE-732, concerning Incorrect Permission Assignment for Critical Resource. The mechanism of bypassing security checks through an alternative interface or code path is also characteristic of ATT&CK technique T1068, Exploitation for Privilege Escalation, although in this case it serves more to maintain existing unauthorized access rather than escalate from a lower privilege level if the user was already authenticated. The root cause is a failure in defense-in-depth strategy; relying on a single layer of permission checking at the query interface without validating those permissions again when delegating execution to internal components creates a fragile security posture. To mitigate this issue, developers must ensure that all code paths leading to sensitive operations perform independent and comprehensive access control checks. This includes auditing the surrealdb.functions bridge implementation to verify that it respects the current session's capabilities before invoking any underlying functions. Additionally, implementing strict allow-lists for JavaScript execution environments and regularly updating SurrealDB to version 4.0.0 or later is essential to resolve this architectural flaw and restore proper security boundaries within the database engine.