Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate as restricted subject with script permission
-
DeliveryInvoke permitted JavaScript function
-
ExploitCall surrealdb.query() bridge bypassing allows_query() gate
-
ExecutionExecute arbitrary SurrealQL
-
ImpactExfiltrate or tamper with database contents
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 | Exploitation requires that the embedded JavaScript scripting engine be in use and that the attacker be an authenticated subject explicitly permitted to run a specific script - i.e., a subject whose capabilities deny arbitrary queries (Capabilities::allows_query() would return false) but allow script execution. From inside that permitted script, the attacker calls the surrealdb.query() bridge, which parses and executes queries without checking allows_query(). Limiting factors: the attacker must already hold valid (low-privileged) credentials and script-run permission, so an instance that does not grant restricted subjects any scripting capability, or that does not expose JavaScript functions, is not exploitable via this path. Not exploitable anonymously and not against configurations where scripting is disabled. Complete fix is upgrading to SurrealDB 4.0.0 or later, which enforces query and function capabilities inside the JavaScript bridge; the advisory presents the update as the remediation. |
| Impact | This is a credible, prioritize-this-week issue rather than a hypothetical high-CVSS flaw, though it is not an emergency on current signals. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N) and the 8.7 score indicate a network-reachable, low-complexity bypass requiring only low privileges - specifically a subject already authenticated and permitted to run a particular JavaScript script. All three impact dimensions are High (VC:H/VI:H/VA:H): a successful bypass yields unrestricted query execution, which in a database means full read, write, and availability impact to the data the server holds. Subsequent-system impact is None (SC/SI/SA:N), so this is confined to the SurrealDB instance's own data boundary rather than pivoting to other systems. The input provides no EPSS score, no CISA KEV listing, and no PoC/exploit reference - only the GHSA advisory and the VulnCheck advisory - so exploitation is best described as plausible-but-unproven in the wild. The vuln.today decision label is 'this_week' (not act_now/emergency), consistent with a serious authorization-bypass that is patched but not yet shown to be actively exploited. The main caveat limiting real-world risk is the precondition: the attacker must already be an authenticated, albeit restricted, subject with permission to run scripting functions, so this is a privilege-escalation-within-the-database problem, not an anonymous remote takeover. |
| Exploit ScenarioDerived | An authenticated SurrealDB subject whose capabilities deny arbitrary queries but allow running a specific JavaScript scripting function invokes the surrealdb.query() bridge from inside that script. Because the bridge parses and executes the supplied query without consulting Capabilities::allows_query(), the restricted subject runs arbitrary SurrealQL beyond its intended operations, reading or modifying any data the server process can access. No public exploit was identified in the provided data; triggering only requires that scripting functions be enabled and reachable by the restricted subject. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 26, 2026
SurrealDB releases before 4.0.0 fail to check query capability inside the embedded JavaScript bridge, so a low-privileged subject who is allowed to run one specific script can call surrealdb.query() from that script and execute arbitrary queries the session's capabilities explicitly deny. Exploitation requires valid credentials plus script-run permission on a deployment that exposes the JavaScript scripting functions; anonymous access or configurations with scripting disabled are not affected via this path. CVSS v3.1 scores it 8.7 (network, low privileges, high confidentiality/integrity/availability impact); no public exploit code or active exploitation is identified at time of analysis, and the priority label is this-week rather than emergency.
RemediationAI
Upgrade to SurrealDB 4.0.0 or later, which enforces query and function capabilities inside the embedded JavaScript bridge so a script can no longer run queries or functions the session denies; the advisory presents updating as the remediation and the change landed in commit 0b8be14543. The vendor advisory at https://github.com/surrealdb/surrealdb/security/advisories/GHSA-fq69-wr4w-v3gm is the authoritative reference for the fixed release. Where the upgrade cannot be applied promptly, the practical compensating control is to stop granting script-run permission to subjects whose capabilities deny arbitrary queries and to keep JavaScript scripting functions unavailable to low-privileged roles, since the bypass only exists for callers inside a permitted script; the trade-off is that legitimate SurrealQL scripting workflows used by those subjects will break until they are moved to trusted roles or scripting is re-enabled after upgrading. Restricting script permission is a narrowing of exposure rather than a complete fix, because any subject still able to run a script retains the bypass on a patched-pending instance.
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 is a Rust-implemented multi-model database whose SurrealQL language supports embedding JavaScript scripting functions, and access control for that scripting surface runs through a Capabilities configuration. The relevant gate is Capabilities::allows_query(), which determines whether a subject may execute arbitrary queries; nested queries issued from SurrealQL functions do consult this gate, but the JavaScript bridge implemented in surrealdb/core/src/fnc/script/modules/surrealdb/query/mod.rs parses and executes the supplied query string without ever calling allows_query(). This is a CWE-862 Missing Authorization weakness: the enforcement point exists but is simply not invoked on one code path, so the intended policy boundary between 'may run a named script' and 'may run arbitrary SurrealQL' collapses. The trigger is described in the source evidence as a script calling surrealdb.query() with attacker-supplied query text; the fix commit (0b8be14543, 'fix(script): JS bridge bypasses the query and function capabilities') enforces both the query and function capabilities inside the embedded JavaScript bridge, and 4.0.0 and later are unaffected. Note that the reported CVSS 4.0 vector is E:X (no exploitation maturity asserted), and the independent assessment re-rates the issue as CVSS 3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
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:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Network-reachable bridge, low complexity, requires an authenticated restricted subject with script permission (PR:L), yielding full read/write/availability over database data within one security scope (S:U).
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
SurrealDB before 4.0.0 contains an authorization bypass vulnerability that allows restricted subjects to execute arbitrary queries by calling the JavaScript surrealdb.query() bridge. Attackers permitted to run a specific script can bypass the Capabilities::allows_query() gate in the query module to execute unrestricted queries beyond their predefined operations.
Technical POC Analysis
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
SurrealDB database deployments prior to version 4.0.0 with JavaScript scripting enabled permit a low-privileged authenticated user to bypass query capability restrictions, enabling execution of arbitrary database queries. This can lead to unauthorized access, modification, or deletion of sensitive data, directly impacting data confidentiality, integrity, and availability. Leadership should prioritize remediation because trusted insiders or compromised low-privilege accounts could exploit this flaw to escalate privileges and compromise critical data stores.
No vendor-released patch identified at time of analysis. Interim mitigations: disable JavaScript scripting entirely, or restrict script-run permissions to trusted administrators only; enforce strict credential management and monitor for anomalous query activity.
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
SurrealDB versions 1.0.0 through 3.x (before 4.0.0) fail to enforce built-in function capability checks inside the embed
Privilege escalation in SurrealDB before v3.1.0 lets unauthenticated attackers hijack the privileges of concurrently-act
Memory exhaustion in SurrealDB 3.0.4 through 3.x lets unauthenticated remote clients pin up to 64 MiB of in-flight WebSo
SQL injection in the Model Context Protocol (MCP) server component of SurrealDB 3.1.0 through 3.x (fixed in 4.0.0) allow
Authenticated tenants of SurrealDB 3.0.0 through 3.x can escape key-based ACL boundaries in direct filesystem buckets an
Filesystem bucket path traversal in SurrealDB 3.0.0 before 4.0.0 allows an attacker with bucket-operation access to read
SurrealDB 1.0.0 through 3.x lets an authenticated user with only the database-level VIEWER role read, modify, and delete
Use-after-free in SurrealDB Core before 3.3.0 can crash or corrupt memory in Rust applications that embed the database a
Cross-bucket file disclosure and modification on Windows affects SurrealDB versions 3.0.0 up to but not including 4.0.0
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
EUVD-2026-136584
NVD
CVE.org
EPSS
GitHub
Exploit-DB