Skip to main content
EPSS 0.4%top 63%

Duplicate Advisory: SurrealDB server-takeover via SurrealQL injection on backup import

0
Critical
Published: 04/11/2025 (04/11/2025, 14:07:34 UTC)
Source: GCVE Database
Product: surrealdb

Description

SurrealDB versions before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 contain a SurrealQL injection vulnerability in the command-line export command. Authenticated users with OWNER or EDITOR roles can create malicious table or field names that inject SurrealQL code. When a higher-privileged user imports the backup, this injected code executes, allowing privilege escalation and root-level takeover of the SurrealDB instance. Applications permitting user-defined tables or fields are vulnerable to a universal second-order SurrealQL injection, even if query parameters are sanitized.

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
High
Subsq. Integrity
High
Subsq. Availability
High
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

Affected software

GitHub Actionsmore threats →ai
surrealdb/surrealdb
pkg:github/surrealdb/surrealdb
Affected versions
<2.0.5>=2.1.0 <2.1.5>=2.2.0 <2.2.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/12/2026, 11:02:26 UTC

Technical Analysis

SurrealDB before versions 2.0.5, 2.1.5, and 2.2.2 fails to properly escape table and field names in the command-line export command. This allows an authenticated System User with OWNER or EDITOR roles to embed malicious SurrealQL code in table or field names. Upon import of the backup by a higher-privileged user, the injected SurrealQL executes, enabling privilege escalation and root-level takeover of the database instance. This vulnerability also exposes applications that allow user-defined tables or fields to a universal second-order SurrealQL injection, bypassing query parameter sanitization.

Potential Impact

An attacker with OWNER or EDITOR roles can escalate privileges to root level by injecting malicious SurrealQL commands via crafted table or field names in backups. This leads to full server takeover of the SurrealDB instance. The vulnerability affects the integrity and confidentiality of the database and can compromise all stored data and operations.

Mitigation Recommendations

A patch is available for this vulnerability. Users should upgrade SurrealDB to versions 2.0.5 or later, 2.1.5 or later, and 2.2.2 or later to remediate this issue. Applying these official fixes will prevent SurrealQL injection via backup import. No additional mitigation steps are required if the patch is applied.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-h5q3-3v5q-v5j8
Osv Schema Version
1.4.0
Aliases
["CVE-2025-71392"]
Database Specific Severity
CRITICAL
Cvss Version
4.0

Threat ID: 6a5ba17e44ab8fbf7c789b97

Added to database: 07/18/2026, 15:53:34 UTC

Last enriched: 09/12/2026, 11:02:26 UTC

Last updated: 10/13/2026, 18:48:16 UTC

Views: 143

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses