{"answers":{"affected":"2 open source packages ship an affected version, including surrealdb.","exploited":"There is no known exploitation of GHSA-jv2j-mqmw-xvv5 in the wild and no public exploit code.","fix":"Upgrade surrealdb to 3.1.5 or later.","what":"GHSA-jv2j-mqmw-xvv5 is a denial of service vulnerability in surrealdb, published on 19 Jun 2026. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-jv2j-mqmw-xvv5 and fix it if it is affected.\n\nWhat it is: GHSA-jv2j-mqmw-xvv5 is a denial of service vulnerability in surrealdb, published on 19 Jun 2026. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-jv2j-mqmw-xvv5 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- surrealdb (crates.io): affected from 3.0.0; fixed in 3.1.5\n- surrealdb (crates.io): affected from 3.0.0; fixed in 3.1.5\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-jv2j-mqmw-xvv5/ (Markdown: https://insights.sbomify.com/GHSA-jv2j-mqmw-xvv5/index.md)","id":"GHSA-jv2j-mqmw-xvv5","markdown":"https://insights.sbomify.com/GHSA-jv2j-mqmw-xvv5/index.md","name":"GHSA-jv2j-mqmw-xvv5","record":{"aliases":[],"analysis":{"component_type":"database","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"SurrealDB database","requires_auth":"low_privilege","summary":"An authenticated user can crash the SurrealDB server by submitting a query with an excessively long chain of operators, causing a stack overflow.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"An authenticated user could crash a SurrealDB server with a single query containing a long chain of operators.\n\nSuch 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.\n\nThe 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.\n\n### Impact\n\nAn 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).\n\n### Patches\n\nA 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.\n\n- Versions 3.1.5 and later are not affected by this issue.\n\n### Workarounds\n\nUsers unable to patch should consider the following workarounds:\n\n- 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).\n- 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.\n- 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.\n\n### References\n\n- [SurrealQL Documentation — Operators](https://surrealdb.com/docs/surrealql/operators)\n- `fix(syn): bound expression operator-tree depth to prevent stack-overflow DoS`","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"SurrealDB: Denial of Service via deep operator chains","id":"GHSA-jv2j-mqmw-xvv5","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"denial_of_service","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["3.1.5"],"introduced":["3.0.0"],"last_affected":[],"package":"surrealdb","purl":null,"source":"GHSA-jv2j-mqmw-xvv5"},{"ecosystem":"crates.io","fixed":["3.1.5"],"introduced":["3.0.0"],"last_affected":[],"package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"GHSA-jv2j-mqmw-xvv5"}],"products":null,"published":"2026-06-19","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"An authenticated user can crash the SurrealDB server by submitting a query with an excessively long chain of operators, causing a stack overflow.","url":"https://insights.sbomify.com/GHSA-jv2j-mqmw-xvv5/"}