GHSA-jv2j-mqmw-xvv5: SurrealDB: Denial of Service via deep operator chains
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.
Published Jun 19, 2026
Affected packages
surrealdb
- Ecosystem
- Rust (crates.io)
- Affected
- >= 3.0.0, < 3.1.5
- Fixed in
- 3.1.5
- Check
cargo tree -i surrealdb
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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-querycapability flag for the affected user classes (guest, record, or system). - Restrict untrusted access to the WebSocket
/rpcendpoint, which accepts larger request bodies than the HTTP/sqlendpoint. The/sqlendpoint'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
fix(syn): bound expression operator-tree depth to prevent stack-overflow DoS
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesCVE-2026-63735
SurrealDB: Custom API route lets authenticated callers override namespace/database scope via URL path
high8.1Sep 4, 2026CVE-2026-63740
SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users
medium6.5Aug 14, 2026CVE-2026-49997
SurrealDB: Edge PERMISSIONS FOR delete bypassed when a connected node is deleted
medium5.4Jul 1, 2026CVE-2026-63743
SurrealDB: Port-specific --deny-net rules silently bypassed on HTTP redirect
medium6.4Jul 1, 2026CVE-2026-63746
SurrealDB: Graph traversal bypasses table SELECT permissions
medium6.5Jul 1, 2026CVE-2026-63748
SurrealDB: Authenticated callers can read fields hidden by field-level SELECT permissions via error messages
medium4.3Jul 1, 2026
