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

GHSA-JV2J-MQMW-XVV5

SurrealDB: Denial of Service via deep operator chains

Parche disponible
Descargar PNG JSON
CVSS
—
medium
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición154 dDesde la divulgación, 19 jun 2026, 5:10 p. m.
Detección150 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 3.1.5
Monitoreo
Detectada
19 jun 26
4 nov 26
17 nov 26
21 nov 26
19 jun 26
28 jul 26
4 sept 26
13 oct 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-JV2J-MQMW-XVV5 divulgada
Remediación Parche 3.1.5 surrealdb · 0 d desde divulgación
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

An authenticated user could crash a SurrealDB server with a single query containing a long chain of operators.

Such a query — for example `RETURN 1 + 1 + 1 + ...` with tens of thousands of terms — is parsed into an expression tree one level deep per operator. Because the chain is flat and the pratt parser appends to it iteratively, the configured query- and object-recursion limits never fire, so the tree grows unbounded with the length of the query.

The root cause: the over-deep tree is later walked recursively, one call per node, when it is dropped, formatted, or lowered for execution — overflowing the thread stack and aborting the process.

Impact

An authenticated user with query-execution privileges can crash a SurrealDB server with a single query containing a long chain of operators. The whole process aborts, denying service to every namespace and database on that instance until it is restarted. The crash occurs during query processing, before any data is read or written (availability only).

Patches

A patch introduces a dedicated expression-depth budget — `expr_recursion_limit`, sourced from `max_expression_parsing_depth` (default 128, configurable via `SURREAL_MAX_EXPRESSION_PARSING_DEPTH`). It is charged once per pratt-parser level and once per operator appended to the spine, so an over-deep operator chain is rejected with a syntax error instead of building a tree that overflows the stack downstream. Paths that re-parse already-validated stored data are exempted, so existing databases with deep stored expressions still load.

  • Versions 3.1.5 and later are not affected by this issue.
Workarounds

Users unable to patch should consider the following workarounds:

  • Restrict the ability of untrusted users to execute arbitrary queries via the `--deny-arbitrary-query` capability flag for the affected user classes (guest, record, or system).
  • Restrict untrusted access to the WebSocket `/rpc` endpoint, which accepts larger request bodies than the HTTP `/sql` endpoint. The `/sql` endpoint's 1 MiB body limit lowers the achievable operator depth but does not by itself guarantee the stack cannot be exhausted.
  • Run SurrealDB under an orchestrator or process manager that restarts it automatically on exit (e.g. Kubernetes, systemd `Restart=on-failure`, or a Docker restart policy), so the server recovers immediately after a crash. This limits downtime from a successful attack but does not prevent the crash.
References
  • SurrealQL Documentation — Operators https://surrealdb.com/docs/surrealql/operators
  • `fix(syn): bound expression operator-tree depth to prevent stack-overflow DoS`
Versiones

Rangos afectados

Afectada Corregida Última
surrealdb≥ 3.0.0 < 3.1.5
3.0.0
3.1.5
4.0.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.iosurrealdb
Corregida 3.1.5 0 d 4.0.1 no afectada
Versiones corregidas3.1.5
Explotación

Arsenal público

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

Referencias
Otrahttps://github.com/surrealdb/surrealdb/security/advisories/GHSA-jv2j-mqmw-xvv5
Otrahttps://github.com/surrealdb/surrealdb

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