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
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.
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
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 before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 lets an authenticated user with
Information disclosure in SurrealDB before 3.1.0 allows authenticated record or scope users to bypass table-level SELECT
Denial of service in SurrealDB before 2.2.2 allows any authenticated user to crash the database by submitting a crafted
Broken authorization in SurrealDB before 3.1.4 allows record-scoped (authenticated) users to read array elements that fi
Same weakness CWE-77 – Command Injection
View allSame technique Privilege Escalation
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2025-210483
GHSA-h5q3-3v5q-v5j8