CVE-2025-71392: SurrealDB SurrealQL injection in command-line export

CVE-2025-71392 · Severity: critical · CVSS 4 · Published 2026-07-18

SurrealDB is a database platform that supports exporting and importing backups via command-line tools. A vulnerability in the export function fails to properly sanitize table and field names, allowing an authenticated user with elevated privileges to embed malicious database commands that execute when a backup is imported by a higher-privileged user. This can result in complete compromise of the database, including unauthorized root-level access and data manipulation.

Technologies: surrealdb (crates.io). Vendors: crates.io.

Quick answers

Is CVE-2025-71392 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-71392 being exploited in the wild.
How severe is CVE-2025-71392?
Critical severity, with a CVSS score of 4, published 18 July 2026.
Which products and versions are affected?
surrealdb (crates.io) SEMVER:introduced=2.2.0,fixed=2.2.2.
Is there a fix for CVE-2025-71392?
Yes. surrealdb (crates.io): upgrade to 2.2.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-71392 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2025-71392?
Check whether you run surrealdb (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • surrealdb (crates.io): upgrade to 2.2.2 or later
    cargo update -p surrealdb

Technical details

This vulnerability is a second-order SurrealQL injection flaw in SurrealDB's export/import functionality (CWE-77: Command Injection). The root cause is improper escaping of special characters in table and field names during the export process. An authenticated System User with OWNER or EDITOR roles can create tables or fields containing malicious SurrealQL syntax. When the exported backup is later reimported by a user with higher privileges (such as a system administrator), the injected SQL commands execute with those elevated privileges. This enables privilege escalation and complete server takeover. The vulnerability affects versions prior to 2.0.5, 2.1.5, and 2.2.2. It requires authentication and user interaction (import operation by a higher-privileged user), but no network-specific preconditions beyond database access. Patches have been released and workarounds involve manual inspection of exports before importing.

Affected products

  • SurrealDB SurrealDB < 2.0.5, >= 2.1.0 and < 2.1.5, >= 2.2.0 and < 2.2.2

Identifiers

  • CVE-2025-71392
  • GHSA-ccj3-5p93-8p42

Timeline

  • 2025-04-11: disclosed
  • 2025-04-11: patched: Versions 2.0.5, 2.1.5, 2.2.2 and later released with fixes

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.