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

Source: https://junglewise.ai/threats/cve-2025-71392-surrealdb-surrealql-injection-in-command-line-export  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-18. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/surrealdb). Vendors: [crates.io](https://junglewise.ai/threats/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

  ```sh
  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

- [https://api.github.com/users/cure53](https://api.github.com/users/cure53)
- [https://github.com/cure53](https://github.com/cure53)
- [https://api.github.com/users/cure53/gists%7B/gist_id%7D](https://api.github.com/users/cure53/gists%7B/gist_id%7D)
- [https://api.github.com/users/cure53/repos](https://api.github.com/users/cure53/repos)
- [https://avatars.githubusercontent.com/u/6709482?v=4](https://avatars.githubusercontent.com/u/6709482?v=4)
- [https://api.github.com/users/cure53/events%7B/privacy%7D](https://api.github.com/users/cure53/events%7B/privacy%7D)

## Related threats

- [SurrealDB use-after-free in KV backends via affinitypool spawn_local](https://junglewise.ai/threats/cve-2026-121417-surrealdb-before-3-3-0-contains-a-use-after-free-vulnerability)
- [SurrealDB JSON parser denial of service via uncontrolled recursion](https://junglewise.ai/threats/surrealdb-json-parser-denial-of-service-via-uncontrolled-recursion-3037f8a0)
- [SurrealDB ES512 algorithm silently downgraded to ES384](https://junglewise.ai/threats/surrealdb-es512-algorithm-silently-downgraded-to-es384-f0af29b8)
- [SurrealDB permission bypass via WHERE clause evaluation](https://junglewise.ai/threats/surrealdb-permission-bypass-via-where-clause-evaluation-afa6f001)
- [SurrealDB authorization bypass in KILL statement](https://junglewise.ai/threats/surrealdb-authorization-bypass-in-kill-statement-fc230d0f)
