Security Digest · Vulnerability record

CVE-2025-71392: SurrealDB server-takeover via SurrealQL injection on backup import

SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 fails to properly escape table and field names in the command-line export command.

CVSS 9.4 Critical EPSS 0.4% · p37

Should you act?

Critical, preconditions apply

Severe if exploited, but exploitation needs conditions that may not apply to you. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
  • EPSS 0.4%, percentile 37: FIRST’s model estimates a 0.4% chance of exploitation activity in the next 30 days, higher than 37% of all scored CVEs (low). EPSS is a probability, not a verdict.
  • Needs an account (low (any account)). Exposure depends on who can log in.
  • Only applies if your dependency tree includes surrealdb (crates.io (Rust)) >= 2.2.0, < 2.2.2, fixed in 2.2.2; surrealdb (crates.io (Rust)) >= 2.1.0, < 2.1.5, fixed in 2.1.5; surrealdb (crates.io (Rust)) < 2.0.5, fixed in 2.0.5. Check your lockfile, including transitive dependencies.

What it is

SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 fails to properly escape table and field names in the command-line export command. An authenticated System User with OWNER or EDITOR roles can create tables or fields with malicious names containing SurrealQL. When a higher-privileged user subsequently imports the exported backup, the injected SurrealQL executes, enabling privilege escalation and root-level takeover of the SurrealDB instance. Applications that let users define custom tables or fields are also exposed to a universal second-order SurrealQL injection even when query parameters are sanitized.

From the GitHub advisory

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.

Weakness type: CWE-77.

Product: surrealdb (crates.io (Rust)) · Assigned by: VulnCheck · Published: 2026-07-18

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
crates.io (Rust)surrealdb>= 2.2.0, < 2.2.22.2.2
crates.io (Rust)surrealdb>= 2.1.0, < 2.1.52.1.5
crates.io (Rust)surrealdb< 2.0.52.0.5
VendorProductAffected versions (per CVE record)
surrealdbsurrealdb< 2.2.2
surrealdbsurrealdb< 2.1.5
surrealdbsurrealdb< 2.0.5

Severity scores

Scored byCVSSScoreVector
VulnCheck4.09.4 CriticalCVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
GitHub4.09.4 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
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Attack requirements: none
  • Privileges required: low (any account)
  • User interaction: passive

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation none, automatable no, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 0.44% probability of exploitation activity in the next 30 days; percentile 37.

Timeline

  • — GitHub-reviewed advisory GHSA-ccj3-5p93-8p42 published (critical)
  • — CVE record published by VulnCheck
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vendor and project advisories, patches

  1. GitHub Security Advisory (GHSA-ccj3-5p93-8p42) github.com

Vulnerability records

  1. GitHub Advisory GHSA-ccj3-5p93-8p42 github.com
  2. CVE.org record CVE-2025-71392 cve.org
  3. NVD entry CVE-2025-71392 nvd.nist.gov

Other references from the CVE record and advisory

  1. VulnCheck Advisory: SurrealDB before 2.2.2 SurrealQL Injection via export vulncheck.com

Critical crates.io (Rust) advisories · Today’s Security Digest