Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate as OWNER/EDITOR System User
-
DeliveryCreate table/field with SurrealQL-laden name
-
ExploitPayload stored in database schema
-
ExecutionAdmin exports and re-imports backup
-
PersistInjected SurrealQL executes as privileged user
-
ImpactRoot-level takeover of SurrealDB instance
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Command injection prevention
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires an authenticated SurrealDB System User holding the OWNER or EDITOR role who can create tables or fields with attacker-chosen names containing SurrealQL (PR:L). The payload is inert until a second, limiting condition is met: a higher-privileged user must run the CLI export and then the import operation on that data (UI:P - user interaction by the victim operator), at which point the injected SurrealQL executes with the importer's privileges. A parallel condition applies to applications built on SurrealDB that let their end users define custom table or field names, which exposes a universal second-order injection even when query parameters are sanitized. Limiting factors: the attacker needs prior authenticated privileged-role access, cannot fire the payload themselves, and depends on a privileged victim performing an export/import cycle on the tainted data - a single-operator install that never imports attacker-influenced backups is not practically exploitable. |
| Impact | The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H, base 9.4) captures the real profile well: network-reachable, low complexity, but gated by two meaningful conditions - the attacker must already hold OWNER or EDITOR on a System User (PR:L), and a higher-privileged user must be induced to import the tainted backup (UI:P). The high subsequent-system impacts (SC/SI/SA:H) correctly reflect the co-tenancy angle where one tenant's payload compromises a shared backend. No EPSS score, KEV listing, or public POC was provided, so exploitation probability signals are absent; this is not evidence of low risk but of a recently-disclosed, audit-found bug with no observed in-the-wild activity yet. The dependence on a privileged import action makes this more of a targeted/insider or multi-tenant escalation primitive than a mass-exploitable remote flaw - priority is high for multi-tenant or backup-driven SurrealDB deployments, lower for single-operator installs that never import untrusted exports. No conflicting signals were found; the main gap is the missing EPSS/POC telemetry. |
| Exploit ScenarioDerived | In a multi-tenant SurrealDB deployment, an attacker holding an EDITOR role creates a table or field whose name embeds SurrealQL statements. When an administrator later exports the database and re-imports the backup - a routine backup/restore or migration workflow - the injected SurrealQL executes with the administrator's privileges, granting the attacker root-level control of the instance. No public POC has been identified, but the low attack complexity and the commonality of backup/restore operations make the required user interaction realistic. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 18, 2026
Privilege escalation via second-order SurrealQL injection in SurrealDB before 2.0.5, 2.1.5, and 2.2.2 lets an authenticated OWNER or EDITOR user embed malicious SurrealQL inside unescaped table or field names that executes when a higher-privileged operator re-imports the CLI-exported backup, yielding root-level takeover of the instance. Reported by VulnCheck and discovered during a cure53 audit, it also enables a universal second-order injection against co-tenanted applications that let end users define custom tables or fields, even when query parameters are otherwise sanitized. There is no public exploit identified at time of analysis and it is not listed in CISA KEV, but the vendor and cure53 both rate the impact Critical (CVSS 4.0 base 9.4).
RemediationAI
Vendor-released patch: upgrade to SurrealDB 2.0.5, 2.1.5, 2.2.2, or later, which fix the exporter's character-escaping bug, per advisory GHSA-ccj3-5p93-8p42 (https://github.com/surrealdb/surrealdb/security/advisories/GHSA-ccj3-5p93-8p42). If upgrading is not immediately possible, the vendor's stated workaround is to manually inspect every exported backup for injected SurrealQL statements before running any import operation, accepting that this manual review is error-prone and does not scale to frequent or automated backups. As additional compensating controls, restrict OWNER and EDITOR System User roles to trusted operators to limit who can create tables or fields, and in applications that expose custom table/field definitions to end users, validate and constrain identifier names to a safe character set before persisting them - noting that overly strict name validation may reject legitimate schema names. See the SurrealDB export/import CLI documentation (https://surrealdb.com/docs/surrealdb/cli/export, https://surrealdb.com/docs/surrealdb/cli/import) for operational context.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in cargo
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
SurrealDB is a modern multi-model database with its own SurrealQL query language and a command-line tool providing export/import backup operations. The root cause is CWE-77 (Command/query injection): the exporter serializes schema object identifiers - table and field names - into SurrealQL statements without escaping special characters, so a name that itself contains SurrealQL syntax is written verbatim into the backup file. Because the malicious payload lies dormant in the exported data and only fires during a later import, this is a classic second-order (stored) injection: the trust boundary is crossed not at write time but when a privileged user imports the backup, and the injected statements run with that importer's privileges. The affected component is the rust/surrealdb package (CPE cpe:2.3:a:surrealdb:surrealdb) across the pre-2.0.5, 2.1.x, and 2.2.x branches.
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:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Network-reachable but needs an authenticated OWNER/EDITOR (PR:L) and a privileged victim's import action (UI:R); payload compromises the shared instance/other tenants, so scope changes (S:C) with full C/I/A impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 fails to properly escape table and field names in the command-line export command. An authenticated System User with OWNER or EDITOR roles can create tables or fields with malicious names containing SurrealQL. When a higher-privileged user subsequently imports the exported backup, the injected SurrealQL executes, enabling privilege escalation and root-level takeover of the SurrealDB instance. Applications that let users define custom tables or fields are also exposed to a universal second-order SurrealQL injection even when query parameters are sanitized.
Executive ViewAI
SurrealDB instances running versions before 2.0.5, 2.1.5, and 2.2.2 are vulnerable to privilege escalation allowing authenticated database users with OWNER or EDITOR roles to achieve root-level compromise when an administrator performs backup restoration. While no public exploit identified at time of analysis, this represents a critical insider risk to any organization where database administration is handled by multiple teams or where application users are granted elevated database roles. The vulnerability is particularly severe in multi-tenant deployments where end-users can define custom tables and fields.
Restrict OWNER and EDITOR role assignments to trusted database administrators only; implement strict input validation on table and field names to prevent SQL injection attacks; disable end-user ability to create custom tables and fields in multi-tenant systems; limit backup and restore operations to authenticated administrative users with comprehensive audit logging; continuously monitor database backup/restore activity for anomalies; enforce network segmentation to minimize exposure of SurrealDB instances to untrusted networks.
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
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
Privilege escalation in SurrealDB before v3.1.0 lets unauthenticated attackers hijack the privileges of concurrently-act
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
SurrealDB versions before 3.3.0 fail to validate a caller's authorization level when the SurrealQL USE statement switche
Cross-tenant data access in SurrealDB before 3.3.0 allows an authenticated namespace- or database-level SYSTEM user to b
Cross-tenant authorization bypass in SurrealDB before 3.2.0 lets any authenticated user reach custom API endpoints belon
Arbitrary file read in SurrealDB before 3.1.5 lets an authenticated database user holding the EDITOR or OWNER role discl
Confused-deputy privilege escalation in SurrealDB before 2.5.0 and before 3.0.0-beta.3 lets a low-privileged user (e.g.
Denial of service in SurrealDB before 3.1.5 lets an authenticated user with query-execution privileges crash the entire
Denial of service in SurrealDB versions before 3.3.0 lets a query-capable authenticated user with embedded JavaScript sc
Authenticated SurrealDB record users can read field values that field-level SELECT permissions are meant to conceal on S
EUVD-2025-210483
GHSA-h5q3-3v5q-v5j8
NVD
CVE.org
EPSS
VulDB
Exploit-DB