Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2024-58364

CVE-2024-58364: SurrealDB DOS Vulnerability

CVE-2024-58364 is a denial of service flaw in SurrealDB caused by uncaught exceptions in span rendering. Malformed queries trigger server crashes. This post covers technical details, affected versions, and mitigation.

Published:

CVE-2024-58364 Overview

CVE-2024-58364 is a denial of service vulnerability in SurrealDB versions before 1.2.1. The flaw resides in the span rendering code used to format query parsing errors. When a query contains errors on line terminator characters, the renderer raises an uncaught exception that panics the server process. Authorized clients can submit malformed queries to crash the database and disrupt availability for all users. The issue is categorized under CWE-248: Uncaught Exception.

Critical Impact

An authenticated attacker can send a single malformed query to crash the SurrealDB server, causing service-wide denial of service until the process is restarted.

Affected Products

  • SurrealDB versions prior to 1.2.1
  • Deployments exposing the query interface to authenticated clients
  • Multi-tenant SurrealDB instances where any authorized client can trigger a global crash

Discovery Timeline

  • 2026-07-18 - CVE-2024-58364 published to NVD
  • 2026-07-22 - Last updated in NVD database

Technical Details for CVE-2024-58364

Vulnerability Analysis

SurrealDB parses SurrealQL queries and, when a syntax error is detected, generates a human-readable diagnostic pointing at the offending token. The span rendering component computes character offsets and line boundaries to underline the problematic portion of the input. When the parse error lands on a line terminator character, the renderer's assumptions about span geometry break, and the code path raises an unhandled exception. Because the exception propagates out of the query-handling task without recovery, the server process panics and terminates.

The vulnerability affects availability only. No data confidentiality or integrity impact has been reported, and privileged access is not required beyond a valid authenticated session. The GitHub Security Advisory GHSA-8xff-473h-f863 confirms the fix landed in version 1.2.1.

Root Cause

The root cause is missing exception handling in the diagnostic rendering path for parser errors. Span calculations assume well-formed input positions, and encountering an error at a line terminator triggers an unchecked condition. Without a guard or fallback formatter, the panic propagates to the server main loop.

Attack Vector

An attacker with any authenticated role capable of submitting queries can craft SurrealQL input designed to fail parsing precisely on a line terminator. Submitting the query over the network interface is sufficient to crash the process. Repeat submissions after each restart produce sustained denial of service. See the VulnCheck Advisory for additional context.

No verified proof-of-concept code is published. The vulnerability mechanism involves submitting a malformed SurrealQL statement where the syntax error aligns with a line-ending character, triggering the panic during error diagnostic rendering.

Detection Methods for CVE-2024-58364

Indicators of Compromise

  • Unexpected SurrealDB process termination or restart events shortly after a client query
  • Panic stack traces referencing the span rendering or error formatting code paths in SurrealDB logs
  • Repeated abnormal disconnects from a single authenticated client submitting parse-error queries

Detection Strategies

  • Monitor SurrealDB server logs for panic messages and abrupt process exits correlated with inbound query traffic
  • Alert on service restarts of the surreal binary or container replicas outside of planned maintenance
  • Track error rates for SurrealQL parse failures per authenticated identity and flag statistical anomalies

Monitoring Recommendations

  • Enable process supervision metrics that expose restart counts and crash exit codes to the SIEM
  • Forward SurrealDB stdout and stderr to centralized logging with retention sufficient for post-incident review
  • Correlate authentication events with query submissions to attribute crash-inducing traffic to specific accounts

How to Mitigate CVE-2024-58364

Immediate Actions Required

  • Upgrade SurrealDB to version 1.2.1 or later on all deployments
  • Audit issued credentials and revoke tokens for accounts that do not require query submission privileges
  • Restrict network exposure of the SurrealDB query endpoint to trusted client networks where feasible

Patch Information

The vendor released a fix in SurrealDB 1.2.1. Details of the corrected span rendering behavior are documented in the GitHub Security Advisory GHSA-8xff-473h-f863. Operators should verify the running version with surreal version after upgrade and confirm all cluster nodes are updated consistently.

Workarounds

  • Place SurrealDB behind a reverse proxy or gateway that restricts query submission to vetted clients
  • Configure automatic process supervision to restart the server rapidly if a crash occurs, reducing outage windows
  • Reduce the blast radius by segmenting workloads across multiple SurrealDB instances so a single crash does not affect all tenants

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.