☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 6.5 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H 🐛 CWE-248
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-58365

CVE-2024-58365 Denial of Service in Surrealdb
📅 PUBLISHED: 2026-07-18 14:17 UTC 🔄 UPDATED: 2026-09-26 06:20 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.45%
👁️
0.45% probability
11.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Affected: Surrealdb — upgrade to patched release
CVSS VECTOR BREAKDOWN 6.5
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: L Privileges Required Low
UI: N User Interaction None
S: U Scope Unchanged
C: N Confidentiality None
I: N Integrity None
A: H Availability High
6.5
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

This report details CVE-2024-58365, a high-severity vulnerability in SurrealDB versions prior to 1.2.0. The flaw resides in the query executor and allows an authenticated attacker to crash the database server by invoking a nonexistent built-in function via a pre-parsed query. This constitutes a Denial of Service (DoS) attack.

Business Impact: Organizations using SurrealDB as a critical data store for web applications, real-time services, or internal tools are at risk. A successful attack can render the database unavailable, disrupting business operations, causing service outages, and potentially leading to data unavailability for dependent applications. The likely attacker is an authenticated user or an attacker who has compromised valid credentials.

Vulnerability Class & Attack Vector: This is an uncaught exception vulnerability (CWE-248) that leads to a server panic. The attack vector is network-based, requiring the attacker to send a crafted pre-parsed query to the SurrealDB server.

Urgency Assessment: The CVSS score is 6.5 (Medium), but the EPSS probability is 0.0%, indicating no known active exploitation in the wild as of the report date. The urgency is moderate; while the impact is a complete server crash, the requirement for authentication and the lack of data confidentiality or integrity impact lower the immediate threat level. However, the potential for service disruption makes patching a priority.

Key Facts:

  • Vendor: SurrealDB
  • Affected Versions: All versions before 1.2.0
  • Patch Status: Unpatched in older versions; fixed in version 1.2.0.
  • CISA KEV: Not listed.
⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

CVSS Breakdown & Threat Level

The CVSS v3.1 vector string for this vulnerability is CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.

  • AV:N (Network): The vulnerability is exploitable remotely over the network. An attacker does not need physical or local access to the server.
  • AC:L (Low): The attack complexity is low. The exploitation does not require special conditions beyond sending a crafted query. No race conditions or complex timing is needed.
  • PR:L (Low): The attacker must have valid credentials to authenticate to the SurrealDB instance. This is a significant mitigating factor, as unauthenticated users cannot directly trigger the vulnerability.
  • UI:N (None): No user interaction is required. The attack is executed programmatically via a query.
  • S:U (Unchanged): A successful attack does not cause the compromised component (the database server) to impact resources beyond its own security scope.
  • C:N (None): There is no loss of confidentiality. The crash does not expose data.
  • I:N (None): There is no loss of integrity. The crash does not allow data modification.
  • A:H (High): The availability impact is high. A successful attack causes a complete shutdown of the SurrealDB server, rendering it unavailable.

Qualitative Severity: Medium (6.5). The score is driven entirely by the high availability impact, but is lowered by the requirement for authentication.

EPSS Interpretation: An EPSS score of 0.0% indicates that the model predicts a negligible probability of exploitation in the wild within the next 30 days. This is typical for a newly published CVE with no known public exploits or active campaigns.

Comparison to Similar CVEs: This vulnerability is similar to other DoS flaws in database systems caused by unhandled exceptions during query parsing or execution. For example, CVE-2023-30839 in PrestaShop or various DoS vulnerabilities in MongoDB's query engine share the same root cause of improper input validation leading to a crash.

Temporal & Environmental Considerations: The temporal score is currently at its default, as there is no official fix or exploit code maturity to adjust it. Organizations should consider their own environmental score. If the SurrealDB instance is exposed to the internet and accessible by many authenticated users, the environmental severity would be higher. If it is isolated on a trusted internal network with strict access controls, the risk is lower.

Technical Deep Dive & Attack Mechanics

Step-by-Step Technical Explanation:

  1. Authentication: The attacker first authenticates to the SurrealDB server using valid credentials.
  2. Query Crafting: The attacker crafts a pre-parsed query. SurrealDB supports a binary protocol for sending pre-parsed queries, which bypasses some of the text-based parsing logic. The attacker constructs a query that calls a built-in function that does not exist in the SurrealDB function library (e.g., fn::nonexistent_function()).
  3. Query Submission: The attacker sends this crafted query to the server's query executor.
  4. Function Resolution: The query executor attempts to resolve the function name. It searches its internal registry of built-in functions.
  5. Uncaught Exception: When the function name is not found, the code path is expected to return an error to the client. However, due to a programming error, an exception is thrown instead of being caught and handled gracefully.
  6. Server Panic: This uncaught exception propagates up the call stack, causing the Rust runtime to panic. In Rust, a panic is a fatal error that typically results in the thread (and often the entire process) aborting.
  7. Denial of Service: The SurrealDB server process crashes, becoming unavailable to all connected clients until it is manually restarted or automatically restarted by a process manager.

Root Cause Analysis: The root cause is a missing or improperly implemented error handling block (e.g., a try...catch or match statement in Rust) in the function resolution logic of the query executor. The developer assumed that all function lookups would succeed or that the failure path would be handled, but a specific code path for nonexistent built-in functions was left unguarded.

Attack Surface: The attack surface is the network port on which the SurrealDB server listens for client connections (default is 8000). The vulnerability is exploitable via the binary protocol used for pre-parsed queries.

Pre-conditions:

  • Network access to the SurrealDB server.
  • Valid authentication credentials for a SurrealDB user.
  • The ability to send pre-parsed queries (a standard feature of the client protocol).

Attack Variants: The primary variant is invoking a nonexistent built-in function. An attacker could potentially enumerate function names to find a nonexistent one, or simply use a random string. The specific function name is irrelevant as long as it is not in the built-in registry.

Why Standard Defenses May Fail:

  • Web Application Firewalls (WAFs): WAFs are typically designed to detect SQL injection or other web-based attacks. The SurrealDB binary protocol is not HTTP, so a standard WAF would not inspect this traffic.
  • Intrusion Detection Systems (IDS): Unless the IDS has specific SurrealDB protocol decoders, it will not understand the binary query format and will not detect the malicious payload.
  • Input Validation: The vulnerability is not in the query content itself, but in the server's handling of a valid query structure that references an invalid function. Standard input sanitization would not prevent this.

Vulnerable vs. Patched Code Analysis

Vulnerable Code (Pseudocode):

// In the query executor's function resolution module
fn resolve_builtin_function(name: &str) -> Result<Function, Error> {
    // Look up the function in a registry
    if let Some(func) = BUILTIN_FUNCTIONS.get(name) {
        Ok(func.clone())
    } else {
        // BUG: This path throws an uncaught exception instead of returning an error
        panic!("Unknown built-in function: {}", name);
    }
}

Patched Code (Pseudocode):

fn resolve_builtin_function(name: &str) -> Result<Function, Error> {
    if let Some(func) = BUILTIN_FUNCTIONS.get(name) {
        Ok(func.clone())
    } else {
        // FIX: Return a proper error to the caller
        Err(Error::UnknownFunction(name.to_string()))
    }
}

Specific Component: The bug resides in the function resolution logic within the query executor module.

What the Patch Changes: The patch replaces the panic!() macro with a proper Err() return. This allows the error to be handled gracefully by the calling code, which can then send an error message back to the client without crashing the server.

Sufficiency of the Fix: The fix is sufficient to prevent the server crash. By returning an error instead of panicking, the server remains stable and can continue processing other queries.

Regression Considerations: The patch is low-risk. It changes the behavior from a crash to a graceful error response. Applications that were relying on the crash behavior (which is unlikely) would need to be updated to handle the new error response. No other functionality should be affected.

Timeline & Disclosure History

  • CVE Publication Date: 2026-07-18T14:17:09.460
  • Estimated Discovery Timeline: The vulnerability was likely discovered by internal security researchers or reported by an external researcher prior to the publication date. The exact discovery date is unknown.
  • Disclosure Process: The CVE was published by the CVE Program. The specific CNA (CVE Numbering Authority) is not identified in the provided data. The vendor (SurrealDB) was presumably coordinated with, leading to the release of version 1.2.0.
  • Known Exploitation in the Wild: No known active exploitation as of 2026-07-18.
  • CISA KEV Addition Date: Not applicable.

Threat Intelligence Context

Threat Actor Profile: This vulnerability is most likely to be exploited by:

  • Script Kiddies / Hacktivists: Individuals seeking to cause disruption or deface services by taking databases offline.
  • Disgruntled Insiders: Authenticated users with legitimate access who wish to cause a denial of service.
  • Ransomware Operators (Low Probability): While ransomware groups typically focus on data encryption and exfiltration, a DoS attack could be used as a distraction or as part of a multi-stage attack.

Attack Campaign Context: There is no evidence of this CVE being used in broader campaigns.

Geographic Targeting Patterns: None known.

Industry Verticals Most at Risk: Any industry using SurrealDB, including:

  • Technology: Startups and companies using SurrealDB for web and mobile backends.
  • Gaming: Game studios using SurrealDB for real-time data.
  • IoT: Companies managing IoT device data.

Connection to Similar Vulnerability Classes: This vulnerability is a classic example of a DoS via unhandled exception, a common flaw in software written in languages like Rust, Go, or C++ where panics or unhandled exceptions can crash the entire process.

Exploitation & Lab Setup

Red Team Section

Lab Setup:

  1. Environment: Use Docker to run a vulnerable version of SurrealDB.
    docker run --name surreal-db-vuln -p 8000:8000 surrealdb/surrealdb:v1.1.1 start --user root --pass root
    
  2. Prerequisites: Install the SurrealDB client (surreal) or use a programming language with a SurrealDB driver (e.g., Rust, JavaScript, Python).
  3. Authentication: Authenticate to the server.
    surreal sql --endpoint http://localhost:8000 --namespace test --database test --user root --pass root
    

Exploitation Walkthrough:

  1. Craft the Malicious Query: The attacker sends a pre-parsed query that calls a nonexistent function. The exact method for sending a pre-parsed query depends on the client library. In the SurrealSQL CLI, this is not directly possible, but using the Rust SDK or the HTTP API with a raw query, the attacker would send:
    RETURN fn::nonexistent_function();
    
  2. Execute the Query: The attacker executes the query.
  3. Observe the Crash: The SurrealDB server process will crash. The Docker container will stop. Any subsequent connection attempts will fail.

Expected Output of Successful Exploitation:

  • The SurrealDB server process terminates.
  • The Docker container exits.
  • Clients receive a connection refused error.
  • Server logs (if accessible) will show a panic message similar to: thread 'main' panicked at 'Unknown built-in function: nonexistent_function', src/executor/mod.rs:XXX.

Post-Exploitation:

  • The attacker has successfully denied service to all legitimate users.
  • The attacker cannot execute code or access data.
  • The attacker may need to re-authenticate if the server is restarted.

Blue Team Section

Detection:

  • Log Monitoring: Monitor SurrealDB server logs for panic messages. A sudden appearance of panicked at 'Unknown built-in function: in the logs is a strong indicator.
  • Availability Monitoring: Implement health checks that ping the SurrealDB server. A sudden and unexpected loss of connectivity is a potential sign of a DoS attack.
  • Anomaly Detection: Monitor for a high volume of queries containing function names that are not part of the standard SurrealDB function library.

Network Traffic Signatures:

  • The attack traffic will be legitimate SurrealDB protocol traffic. The distinguishing feature is the query payload containing a call to a nonexistent function.
  • The response will be a TCP RST or connection close, as the server crashes.

Endpoint Behavioral Indicators:

  • The SurrealDB process (surreal) will exit unexpectedly.
  • A core dump file may be generated if the system is configured to do so.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • SurrealDB protocol traffic containing function names not in the standard library (e.g., fn::random_string_123).
    • Sudden termination of the SurrealDB TCP connection without a proper shutdown sequence.
  • HTTP Request Patterns (if using HTTP API):
    • POST requests to /sql with a body containing RETURN fn::<random_string>().
  • File System Artifacts:
    • Core dump files (e.g., core.surreal.12345) in the working directory of the SurrealDB process.
  • Process Execution Anomalies:
    • The surreal process exiting with a non-zero exit code.
  • Log Entries:
    • Server logs containing the string panicked at 'Unknown built-in function:.

STIX-like IOC List:

Type Value Description
x-surrealdb-function-name fn::nonexistent_function() Example of a malicious query payload.
windows-registry-key N/A Not applicable.
file core.surreal.* Potential core dump file.
log panicked at 'Unknown built-in function: Key log entry indicating exploitation.

Detection Engineering

YARA Rule

rule CVE-2024-58365_Detection {
    meta:
        description = "Detects exploitation of CVE-2024-58365 in Surrealdb via log files"
        author = "Valters IT Hub"
        date = "2026-07-18"
        reference = "https://www.valtersit.com/cve/cve-2024-58365"
    strings:
        $panic_msg = "panicked at 'Unknown built-in function:"
    condition:
        $panic_msg
}

Sigma Rule (SIEM)

title: CVE-2024-58365 Surrealdb Exploitation Detection
id: 9a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects exploitation attempts targeting CVE-2024-58365 via server panic logs
author: Valters IT Hub
date: 2026-07-18
references:
    - https://www.valtersit.com/cve/cve-2024-58365
logsource:
    category: application
    product: surrealdb
detection:
    selection:
        EventID: 1000  # Example Windows Event ID for application error
        Message|contains: "panicked at 'Unknown built-in function:"
    condition: selection
falsepositives:
    - Legitimate administrative activity (unlikely)
level: high

Suricata IDS Rule

alert tcp $EXTERNAL_NET any -> $HOME_NET 8000 (msg:"CVE-2024-58365 Surrealdb DoS Attempt"; flow:to_server,established; content:"|00|"; depth:1; content:"fn::"; distance:0; within:100; content:"nonexistent_function"; distance:0; within:50; classtype:attempted-dos; sid:1000001; rev:1;)

Note: This rule is a generic example. The exact binary protocol format of SurrealDB pre-parsed queries is needed for a precise rule. The rule above looks for the string "fn::" followed by a nonexistent function name in the TCP stream.

Elastic (EQL) Query

// EQL query to find SurrealDB process crashes
process where event.type == "termination" and process.name == "surreal" and process.exit_code != 0
// EQL query to find panic messages in logs
file where file.name == "surrealdb.log" and file.text : "*panicked at 'Unknown built-in function:*"

Splunk SPL Query

index=main sourcetype=surrealdb:log "panicked at 'Unknown built-in function:"
| table _time, host, source, message
| sort - _time

Wazuh Rule

<group name="surrealdb,">
  <rule id="100001" level="12">
    <decoded>surrealdb</decoded>
    <match>panicked at 'Unknown built-in function:</match>
    <description>SurrealDB CVE-2024-58365 Exploitation Attempt Detected</description>
    <mitre>
      <id>T1499</id>
    </mitre>
  </rule>
</group>

Remediation & Mitigation

Immediate Actions (0-24 hours)

  1. Apply the Patch: Upgrade SurrealDB to version 1.2.0 or later.
    # Using Docker
    docker pull surrealdb/surrealdb:v1.2.0
    docker stop surreal-db-vuln
    docker run --name surreal-db-secure -p 8000:8000 surrealdb/surrealdb:v1.2.0 start
    
  2. Network-Level Mitigation: If patching is not immediately possible, restrict network access to the SurrealDB server to only trusted IP addresses using a firewall. This limits the attack surface.
  3. Authentication Hardening: Enforce strong, unique passwords for all SurrealDB users. Implement multi-factor authentication if supported. Regularly audit user accounts and revoke unused ones.

Short-term (1-7 days)

  1. Configuration Hardening: Review SurrealDB configuration for any unnecessary features or exposed endpoints.
  2. Monitoring Implementation: Deploy the detection rules provided in this report to monitor for exploitation attempts.
  3. Vulnerability Scanning: Use a vulnerability scanner to confirm that all SurrealDB instances are running version 1.2.0 or later.
    # Example using a custom script to check version
    surreal sql --endpoint http://localhost:8000 --namespace test --database test --user root --pass root "SELECT * FROM sys::version();"
    

Long-term

  1. Architecture Changes: Consider placing SurrealDB behind a dedicated API gateway or proxy that can perform additional input validation and rate limiting.
  2. Security Control Improvements: Implement a Web Application Firewall (WAF) that can understand the SurrealDB protocol, if available.
  3. Developer Training: Educate development teams on the importance of proper error handling, especially in systems languages like Rust, to prevent uncaught exceptions from causing DoS vulnerabilities.

Validation

To confirm the patch was applied:

  1. Check the SurrealDB version by connecting to the server and running:
    SELECT * FROM sys::version();
    
    The output should show version 1.2.0 or higher.
  2. Attempt to trigger the vulnerability by sending a query with a nonexistent function. The server should return an error message (e.g., "Unknown function") instead of crashing.

References & Resources


Report generated by Valters IT Hub Neural Engine v25 | 2026-07-18 | https://www.valtersit.com/cve/cve-2024-58365

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-58365/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.