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. (CVE-2025-71392)
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.
AI Analysis
Technical Summary
SurrealDB before versions 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 injection payloads. When a higher-privileged user imports the exported backup, the injected SurrealQL executes, resulting in privilege escalation and root-level takeover of the SurrealDB instance. This vulnerability also allows universal second-order SurrealQL injection in applications that permit user-defined tables or fields, even if query parameters are sanitized. The vulnerability is tracked as CVE-2025-71392 and classified under CWE-77 (Improper Neutralization of Special Elements used in a Command).
Potential Impact
Successful exploitation allows an authenticated user with OWNER or EDITOR roles to escalate privileges to root-level access on the SurrealDB instance by injecting malicious SurrealQL commands through table or field names. This can lead to complete compromise of the database and potentially the underlying system. The vulnerability also affects applications that allow user-defined tables or fields, exposing them to second-order injection attacks despite query parameter sanitization.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict OWNER and EDITOR role assignments to trusted users only and avoid importing backups from untrusted sources. Monitor vendor communications for patches addressing this issue.
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. (CVE-2025-71392)
Description
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.
CVSS v4.0
Affected software
pkg:github/surrealdb/surrealdbRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
SurrealDB before versions 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 injection payloads. When a higher-privileged user imports the exported backup, the injected SurrealQL executes, resulting in privilege escalation and root-level takeover of the SurrealDB instance. This vulnerability also allows universal second-order SurrealQL injection in applications that permit user-defined tables or fields, even if query parameters are sanitized. The vulnerability is tracked as CVE-2025-71392 and classified under CWE-77 (Improper Neutralization of Special Elements used in a Command).
Potential Impact
Successful exploitation allows an authenticated user with OWNER or EDITOR roles to escalate privileges to root-level access on the SurrealDB instance by injecting malicious SurrealQL commands through table or field names. This can lead to complete compromise of the database and potentially the underlying system. The vulnerability also affects applications that allow user-defined tables or fields, exposing them to second-order injection attacks despite query parameter sanitization.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict OWNER and EDITOR role assignments to trusted users only and avoid importing backups from untrusted sources. Monitor vendor communications for patches addressing this issue.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-h5q3-3v5q-v5j8
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-71392"]
- Ecosystems
- []
- Database Specific Severity
- CRITICAL
- Cvss Version
- 4.0
Threat ID: 6a5ba17e44ab8fbf7c789b97
Added to database: 07/18/2026, 15:53:34 UTC
Last enriched: 07/18/2026, 16:22:16 UTC
Last updated: 07/18/2026, 19:37:15 UTC
Views: 14
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.