llamaCVEVulnerability Intelligence
/
Advisory · GitHub · crates.io · surrealdb

GHSA-CCJ3-5P93-8P42

SurrealDB server-takeover via SurrealQL injection on backup import

Parche disponible
Descargar PNG JSON
CVSS
—
critical
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche3 versionesPrimer parche a -1 d de la divulgación
Exposición587 dDesde la divulgación, 11 abr 2025, 9:07 a. m.
Detección584 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Parche 2.0.5 +2
Monitoreo
Detectada
10 abr 25
11 abr 25
4 sept 26
17 nov 26
19 nov 26
10 abr 25
4 sept 25
29 ene 26
25 jun 26
19 nov 26
FechaFaseEventoDetalle
Remediación Parche 2.0.5 surrealdb · -1 d desde divulgación
Remediación Parche 2.1.5 surrealdb · -1 d desde divulgación
Remediación Parche 2.2.2 surrealdb · -1 d desde divulgación
Divulgación Publicada GHSA-CCJ3-5P93-8P42 divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

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.

### Impact
This attack can be used to perform privilege escalation and complete takeover (root access) of the SurrealDB instance, as well as being able to perform SurrealQL injection attacks against co-tenanted applications where SurrealDB is used as a shared backend for multiple applications.

### Patches
A patch has been created that addresses the issue by fixing the bugs in the exporter which failed to escape some characters properly.

  • Versions 2.0.5, 2.1.5, 2.2.2 and later are not affected by this issue.

### Workarounds
For SurrealDB users that are unable to upgrade, users that are looking to perform `import` operations must manually inspect the exported data for injected statements, prior to importing.

### Resources
SurrealDB Documentation - Export https://surrealdb.com/docs/surrealdb/cli/export
SurrealDB Documentation - Import https://surrealdb.com/docs/surrealdb/cli/import
SurrealDB Documentation - Authentication https://surrealdb.com/docs/surrealdb/security/authentication

Versiones

Rangos afectados

Afectada Corregida Última
surrealdb< 2.0.5
surrealdb≥ 2.1.0 < 2.1.5
surrealdb≥ 2.2.0 < 2.2.2
2.0.5
2.1.0
2.1.5
2.2.0
2.2.2
4.0.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.iosurrealdb
Corregida 2.0.5, 2.1.5, 2.2.2 -1 d · -1 d · -1 d 4.0.1 no afectada
Versiones corregidas2.0.52.1.52.2.2
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2025-71392
Otrahttps://github.com/surrealdb/surrealdb/security/advisories/GHSA-ccj3-5p93-8p42
Otrahttps://github.com/surrealdb/surrealdb
Otrahttps://www.vulncheck.com/advisories/surrealdb-before-surrealql-injection-via-export

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.