External risk intelligence

SurrealDB Escape Sequence Privilege Escalation

CVE advisorySeverity: CRITICAL (CVSS 9.4)

CVE-2025-71392

This vulnerability requires an authenticated user with OWNER or EDITOR roles to create malicious objects, followed by a separate higher-privileged user performing a database export/import operation. This multi-step process involving specific database administrative actions makes it unlikely to be reachable via typical public internet exposure.

Privilege Escalation

Halo Surface Signal: 2 out of 5 — less likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

This advisory concerns a vulnerability in SurrealDB that could allow an authenticated user to escalate privileges. The issue arises from how the system handles specially crafted table and field names during data export, which can lead to the execution of unauthorized commands when imported by a higher-privileged user. This could result in a full takeover of the database instance.

  • Unauthenticated users can gain elevated privileges.
  • Impacts systems allowing custom table or field names.
  • Confirm relevance and potential exposure to the database.

Attack Path

How an attacker could exploit the issue

An attacker with OWNER or EDITOR privileges in SurrealDB could craft malicious table or field names containing SurrealQL. When a more privileged user imports a backup containing these specially crafted names, the injected SurrealQL executes, potentially leading to a complete takeover of the database. This attack also affects applications allowing custom table or field definitions if they are not properly handling user input during export and import processes.

  • Authenticated user with specific roles required.
  • Malicious export/import of tables or fields.
  • Privilege escalation and instance takeover.

Live Threat

Current exploitation, exposure, and threat context

This vulnerability could allow an authenticated user with specific roles to inject malicious commands into SurrealDB through specially crafted table or field names during the export process. When a higher-privileged user later imports this exported data, the injected commands could execute, potentially leading to unauthorized control of the database instance. Applications allowing users to define custom tables or fields are also at risk of this injection.

  • System data and service behavior at risk.
  • Malicious names in exported data.
  • Potential for privilege escalation and takeover.

Operational Fix

Recommended remediation, mitigation, and detection steps

This vulnerability impacts SurrealDB instances where users can define custom tables or fields. The primary concern lies with applications allowing user-defined schemas, as these could be manipulated by authenticated users with OWNER or EDITOR roles. The initial practical step is to identify all SurrealDB instances, confirm their accessibility and business criticality, and then locate the application owners or platform teams responsible for managing these databases to initiate a risk-based remediation plan.

  • Identify SurrealDB instances and owners.
  • Verify user-defined table/field export/import.
  • Plan coordinated remediation with platform teams.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is SurrealDB?

SurrealDB is a multi-model, scalable database engine that combines the capabilities of traditional relational databases, document stores, and graph databases. It is designed for modern cloud-native applications, allowing developers to store and query complex data structures efficiently. This vulnerability specifically affects how the system handles metadata—like table and field names—during data export and import workflows.

What is the weakness in CVE-2025-71392?

This vulnerability is classified as CWE-77: Improper Neutralization of Special Elements used in a Command. In plain terms, SurrealDB fails to properly escape inputs when exporting database schemas. Because it doesn't separate the database's structural names from executable commands, a malicious user can embed SurrealQL instructions directly into table or field names. When those names are imported later, the database mistakenly interprets and runs that embedded code as a command.

How is this vulnerability triggered?

An attacker needs two conditions. First, they must already have authenticated access to the database with OWNER or EDITOR roles to create objects with malicious names. Second, a higher-privileged user must manually trigger a backup export and subsequently import that file. Crucially, simply viewing data or performing standard read queries does not trigger the bug; the payload only activates during the specific administrative act of importing exported database files.

Is my system at risk of this CVE?

Halo Surface Signal labels the likelihood of this risk as Unlikely for typical public-facing instances. Because the attack requires an authenticated user with elevated roles to perform multiple manual steps, it is not a simple drive-by exploit. You should focus your investigation on environments where untrusted users can influence schema creation and where internal teams frequently perform administrative export and import operations on shared databases.

How do I respond to this SurrealDB issue?

First, identify all SurrealDB instances in your environment and determine which ones allow users or applications to define custom tables or fields. Coordinate with your platform teams to confirm whether your current administrative workflows involve importing backups from less-trusted sources. The primary goal is to restrict the ability to define schema objects to only highly trusted users and to monitor database import processes for unauthorized modifications.

References