Skip to main content

CVE-2025-71392 — Vulnerability in surrealdb — CVE Details

CRITICAL

SurrealDB server-takeover via SurrealQL injection on backup import

Published April 11, 2025Updated September 4, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.44%). Schedule for your next planned update.

Does your project use an affected surrealdb version?

Paste your Cargo.lock to check it for CVE-2025-71392 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Cargo.lock

Summary

The SurrealDB command-line tool allows exporting databases through the export command. It was discovered that table or field names are not properly sanitized in exports, leading to a SurrealQL injection when the backup is reimported.

For the injection to occur, an authenticated System User with OWNER or EDITOR roles needs to create tables or fields with malicious names containing SurrealQL, subsequently exported using the export operation

The attacker could achieve a privilege escalation and root level access to the SurrealDB instance if a higher privileged user subsequently performs the import operation.

Furthermore, applications using SurrealDB that allow its users to define custom fields or tables are at risk of a universal second order SurrealQL injection, even if query parameters are properly sanitized.

This issue was discovered and patched during an code audit and penetration test of SurrealDB by cure53, the severity defined within cure53's preliminary finding is Critical, matched by our CVSS v4 assessment.

Impact

This attack can be used to perform privilege escalation and complete takeover (root access) of the SurrealDB instance, as well as being able to perform SurrealQL injection attacks against co-tenanted applications where SurrealDB is used as a shared backend for multiple applications.

Patches

A patch has been created that addresses the issue by fixing the bugs in the exporter which failed to escape some characters properly.

  • Versions 2.0.5, 2.1.5, 2.2.2 and later are not affected by this issue.

Workarounds

For SurrealDB users that are unable to upgrade, users that are looking to perform import operations must manually inspect the exported data for injected statements, prior to importing.

Resources

SurrealDB Documentation - Export SurrealDB Documentation - Import SurrealDB Documentation - Authentication

Advisory Timeline

  • First published April 11, 2025 (595 days ago).
  • Last revised September 4, 2026 — 511 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update surrealdb to 2.1.5 or later
cargo update -p surrealdb --precise 2.1.5
Cargo
Update surrealdb to 2.2.2 or later
cargo update -p surrealdb --precise 2.2.2
Cargo
Update surrealdb to 2.0.5 or later
cargo update -p surrealdb --precise 2.0.5

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: crates.io (1).

PackageFixed In
surrealdb crates.io · Affected: All versions2.1.5
surrealdb crates.io · Affected: All versions2.2.2
surrealdb crates.io · Affected: All versions2.0.5

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.0 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
P
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

Frequently Asked Questions

What is CVE-2025-71392?
SurrealDB server-takeover via SurrealQL injection on backup import. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.0/10).
How do I check if my project is affected by CVE-2025-71392?
CVE-2025-71392 affects surrealdb. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-71392 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.0

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.44%
EPSS percentile: 30.3

This is a below-median EPSS score — only 30.3% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-ccj3-5p93-8p42

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock