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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
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
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Lifecycle Timeline
4DescriptionCVE.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.
AnalysisAI
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).
Technical ContextAI
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.
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.
Denial of service in SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 lets an authenticated user with
Denial of service in SurrealDB before 2.2.2 allows any authenticated user to crash the database by submitting a crafted
Denial of service in SurrealDB before 2.2.2 lets an authenticated user crash the database by calling the string::replace
Memory exhaustion in SurrealDB's scripting subsystem allows authenticated users to bypass the server's recursion depth l
Server-side request forgery in SurrealDB before versions 2.0.5, 2.1.5, and 2.2.2 allows authenticated users to circumven
DNS rebinding SSRF bypass in SurrealDB's http::* query functions allows authenticated low-privileged users to reach inte
SurrealDB versions 3.0.0 through 3.1.4 expose a query-planner authorization bypass that allows authenticated record user
Local file read via DEFINE ANALYZER in SurrealDB before versions 2.1.5 and 2.2.2 allows authenticated users holding root
Resource exhaustion in SurrealDB's embedded JavaScript scripting feature allows authenticated users to deny service by s
Same weakness CWE-77 – Command Injection
View allSame technique Command Injection
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2025-210483
GHSA-h5q3-3v5q-v5j8