Description
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.
Published: 2026-07-18
Score: 9.4 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

SurrealDB versions prior to 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 do not properly escape table and field names in the command‑line export command. An authenticated System User with OWNER or EDITOR privileges can create maliciously named tables or fields that contain SurrealQL statements. When a higher‑privileged user subsequently imports the exported backup, the injected SurrealQL code executes, allowing the attacker to elevate privileges and take full control of the SurrealDB instance. Applications that permit user defined tables or fields are likewise exposed to a universal second‑order SurrealQL injection, even if individual query parameters are sanitized. This vulnerability is classified as CWE‑77.

Affected Systems

The affected vendor is SurrealDB, product SurrealDB. The vulnerability applies to all releases before version 2.0.5, any 2.1.x series prior to 2.1.5, and the 2.2.x series before 2.2.2. Any deployment using these versions without the necessary patch is susceptible.

Risk and Exploitability

The severity is reflected in a CVSS score of 9.4 and an EPSS score of less than 1%, indicating a high impact but low current exploitation probability. The vulnerability is not listed in CISA’s KEV catalog. Exploitation requires an authenticated user with OWNER or EDITOR privileges to create malicious names and a separate privileged user to import the compromised export. The attack path is therefore limited to environments where such role separation exists or where applications allow arbitrary table or field creation.

Generated by OpenCVE AI on July 30, 2026 at 23:03 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade SurrealDB to version 2.2.2 or later to remove the unescaped export vulnerability
  • Revoke or limit OWNER and EDITOR privileges on environments that handle export files, ensuring only trusted staff can perform imports
  • Implement strict naming conventions or whitelist validation for table and field names to prevent injection via malicious identifiers

Generated by OpenCVE AI on July 30, 2026 at 23:03 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 28 Jul 2026 02:30:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:surrealdb:surrealdb:*:*:*:*:*:*:*:*

Thu, 23 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
First Time appeared Surrealdb
Surrealdb surrealdb
Vendors & Products Surrealdb
Surrealdb surrealdb

Tue, 21 Jul 2026 03:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Sat, 18 Jul 2026 13:45:00 +0000

Type Values Removed Values Added
Description 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.
Title SurrealDB before 2.2.2 SurrealQL Injection via export
Weaknesses CWE-77
References
Metrics cvssV4_0

{'score': 9.4, 'vector': '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'}


Subscriptions

Surrealdb Surrealdb
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-28T01:48:16.238Z

Reserved: 2026-07-16T12:14:41.770Z

Link: CVE-2025-71392

cve-icon Vulnrichment

Updated: 2026-07-21T02:40:36.767Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-30T23:15:06Z

Weaknesses
  • CWE-77

    Improper Neutralization of Special Elements used in a Command ('Command Injection')