CVE-2025-71392

SurrealDB before 2.2.2 SurrealQL Injection via export

Published Jul 18, 2026 CVSS 4.0 · 9.4 Critical EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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

Source ID Title
Github GHSA Github GHSA GHSA-ccj3-5p93-8p42 SurrealDB server-takeover via SurrealQL injection on backup import
History
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 8.0, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
CPEs cpe:2.3:a:surrealdb:surrealdb:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Surrealdb
Surrealdb surrealdb
Vendors & Products Surrealdb
Surrealdb surrealdb
Type Values Removed Values Added
Metrics ssvc

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

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'}

Weaknesses
  • CWE-77

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

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 29, 2026, 9:15 PM
Reserved
Jul 16, 2026, 12:14 PM
Status
Analyzed
Published
Jul 18, 2026, 2:17 PM
Modified
Oct 29, 2026, 9:17 PM