Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate with restricted function capabilities
-
DeliveryDefine embedded JavaScript function
-
ExploitCall denied function via surrealdb.functions bridge
-
ExecutionBridge invokes fnc dispatchers skipping checks
-
ImpactExecute denied built-in functions
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization checks on every request
MITRE ATT&CK
1 technique across 1 tactic: Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires (1) a valid authenticated SurrealDB session on a version in the 1.0.0-to-before-4.0.0 range, (2) that the account has been explicitly denied one or more built-in functions via SurrealDB's function capability restrictions, and (3) availability of the embedded JavaScript scripting engine so the user can define script functions and reach the surrealdb.functions.* bridge. The attack is only meaningful where operators depend on function capabilities as a security boundary (e.g., multi-tenant or least-privilege setups); deployments that do not restrict functions, or that disable embedded scripting, gain nothing for an attacker. Limiting factors: authentication is mandatory, scripting must be reachable, and the only complete fix per the vendor is upgrading to 4.0.0 (which enforces check_function_capability() inside the bridge). |
| Impact | The input assigns a CVSS 4.0 base score of 9.3 (Critical) and vuln.today sets the decision label to act_now, with the issue reported by VulnCheck and a confirmed vendor advisory (GHSA-5w6j-qm42-4rc2) plus a fix commit (0b8be14543). However, several signals are missing or conflicting and temper real-world urgency. KEV status is absent (treat as not listed), no EPSS score is provided, and no working exploit is referenced - only the vendor advisory and the fix commit, which are not exploit code. The most important conflict: the supplied CVSS 4.0 vector states PR:N (no privileges), but the description and advisory explicitly require an AUTHENTICATED user who has already been denied access to certain built-in functions. This is an authorization/capability bypass (CWE-862), not a pre-auth break, so PR:N appears mislabeled - verify with the vendor; a privileged-but-restricted session is a prerequisite. Realistic risk is therefore concentrated in multi-tenant or least-privilege SurrealDB deployments that rely on function capability restrictions to sandbox users AND have the embedded JavaScript scripting engine available; in single-trust or scripting-disabled deployments the practical impact is far lower than the Critical score suggests. Net: a genuine, vendor-confirmed authorization bypass worth prioritizing where function capabilities are a security boundary, but not an unauthenticated internet-wormable issue despite the headline PR:N vector. |
| Exploit ScenarioDerived | In a SurrealDB deployment that uses function capability restrictions to limit what a tenant or low-trust account can run, an authenticated user who is denied a sensitive built-in function writes an embedded JavaScript function and calls that same function through the surrealdb.functions.* bridge. Because the bridge invokes the internal fnc::synchronous()/fnc::asynchronous() dispatchers without the capability check, the denied function executes anyway. No public exploit is identified at time of analysis, but the mechanism is documented in the vendor advisory with the exact affected file and functions. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 21, 2026
SurrealDB versions 1.0.0 through 3.x (before 4.0.0) fail to enforce built-in function capability checks inside the embedded JavaScript bridge, so an authenticated user who has been explicitly denied a function in SurrealQL can still invoke it through surrealdb.functions.* from a script function. The flaw (CWE-862 missing authorization, assessed CVSS 3.1 7.2-class AV:N/AC:L/PR:L/UI:N with high confidentiality, integrity and availability impact; the input also carries a CVSS 4.0 score of 9.3) only yields access the user was denied, so it matters where function capabilities are used as a real security boundary, such as multi-tenant or least-privilege deployments. vuln.today marks the decision label act_now, a vendor advisory (GHSA-5w6j-qm42-4rc2) and fix commit are available, and no public exploit code was identified at time of analysis.
RemediationAI
Upgrade to SurrealDB 4.0.0 or later, the vendor-released fix that adds check_function_capability() to the embedded JavaScript built-in bridge so a denied function can no longer be reached from script (fix commit 0b8be14543, "fix(script): JS bridge bypasses the query and function capabilities"); per the vendor this upgrade is the only complete remediation, and back-porting the capability check to 1.x/2.x/3.x deployments is not listed in the supplied references. Because the bypass is reached only through the embedded JavaScript engine, disabling or refusing to expose script functions removes the attack path on versions that cannot yet be upgraded, at the cost of losing JavaScript-defined functions entirely; note that tightening function capability grants alone does not help, since the flaw is precisely that those grants are ignored on the script path. Prioritize the upgrade to 4.0.0 in multi-tenant or least-privilege clusters where function restrictions are treated as a security boundary, per the act_now decision label. Full details are in https://github.com/surrealdb/surrealdb/security/advisories/GHSA-5w6j-qm42-4rc2 and https://www.vulncheck.com/advisories/surrealdb-1.0.0-before-4.0.0-function-capability-bypass-via-javascript-built-in-bridge.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
SurrealDB supports embedded JavaScript as a SurrealQL function type (DEFINE FUNCTION ... { ... } script bodies), and exposes a bridge that lets that JavaScript reach built-in functions through the surrealdb.functions.* namespace. In surrealdb/core/src/fnc/script/modules/surrealdb/functions/mod.rs, the run() and fut() handlers pass calls straight to the internal dispatchers fnc::synchronous() and fnc::asynchronous(). SurrealQL itself routes built-ins through Function::compute() and BuiltinFunctionExec::evaluate(), which consult the configured function capabilities and reject calls an account is not permitted to make; the JavaScript path skips that gate entirely. The root cause is therefore a missing authorization check (CWE-862) on an alternate code path rather than a memory-safety problem: the bridge simply does not call check_function_capability() before delegating, so the scripting engine becomes a way around the policy the query engine enforces. The affected package is rust/surrealdb, mapped by CPE cpe:2.3:a:surrealdb:surrealdb with a version range of 1.0.0 up to (but excluding) 4.0.0; the trigger requires a reachable scripting engine and an account that is actually denied at least one built-in function, so a deployment without function restrictions presents no boundary to bypass.
Know when Surrealdb gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Requires an authenticated but capability-restricted account, so PR:L not PR:N; network-reachable, low complexity, and bypassing function restrictions can yield high C/I/A via otherwise-denied built-ins.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
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.
Technical POC Analysis
Bug class: CWE-862 Missing Authorization.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
A critical authorization bypass in SurrealDB (versions 1.0.0 through 3.x) allows authenticated users to circumvent explicitly denied capabilities for built-in functions via the embedded JavaScript bridge. This undermines least-privilege and multi-tenant security boundaries, enabling users to perform unauthorized actions with high impact on confidentiality, integrity, and availability. Leadership should prioritize remediation because the flaw directly weakens access controls that may protect sensitive data and system operations.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Privilege escalation via second-order SurrealQL injection in SurrealDB before 2.0.5, 2.1.5, and 2.2.2 lets an authentica
Privilege escalation in SurrealDB before v3.1.0 lets unauthenticated attackers hijack the privileges of concurrently-act
SQL injection in the Model Context Protocol (MCP) server component of SurrealDB 3.1.0 through 3.x (fixed in 4.0.0) allow
Use-after-free in SurrealDB Core before 3.3.0 can crash or corrupt memory in Rust applications that embed the database a
Denial of service in SurrealDB before 3.1.0 lets an unauthenticated remote attacker crash the database with a single Web
Denial of service in SurrealDB before 3.1.0 lets an unauthenticated remote attacker crash the entire database process wi
Session hijacking in SurrealDB before 3.1.0 lets unauthenticated attackers enumerate attached session UUIDs through the
Filesystem bucket path traversal in SurrealDB 3.0.0 before 4.0.0 allows an attacker with bucket-operation access to read
Cross-bucket file disclosure and modification on Windows affects SurrealDB versions 3.0.0 up to but not including 4.0.0
Authenticated tenants of SurrealDB 3.0.0 through 3.x can escape key-based ACL boundaries in direct filesystem buckets an
Memory exhaustion in SurrealDB 3.0.4 through 3.x lets unauthenticated remote clients pin up to 64 MiB of in-flight WebSo
SurrealDB 1.0.0 through 3.x lets an authenticated user with only the database-level VIEWER role read, modify, and delete
EUVD-2026-132235
GHSA-cr6h-wmmv-79vp
NVD
CVE.org
EPSS
Exploit-DB