GHSA-rq86-9m6r-cm3g: Surrealdb SurrealDB Has Uncaught Exception Vulnerability

HIGH
CWE-248
Published
Advisory Summary

GHSA-rq86-9m6r-cm3g is a HIGH surrealdb has uncaught exception vulnerability (CWE-248: Uncaught Exception) affecting Surrealdb libraries in the crates.io ecosystem. The issue involves surrealdb has uncaught exception in net module that leads to database crash. Remediation is available by upgrading affected packages to version 2.2.2, 2.1.5, 2.0.5.

GHSA-rq86-9m6r-cm3g at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-rq86-9m6r-cm3g
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-248: Uncaught Exception
Affected Product Surrealdb
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-rq86-9m6r-cm3g

To remediate this vulnerability, upgrade all affected Surrealdb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

surrealdb fixed: 2.2.2
Upgrade surrealdb to 2.2.2
surrealdb fixed: 2.1.5
Upgrade surrealdb to 2.1.5
surrealdb fixed: 2.0.5
Upgrade surrealdb to 2.0.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for surrealdb

How to Check if You Are Affected

To determine whether your application is affected by GHSA-rq86-9m6r-cm3g, inspect your project dependencies for Surrealdb:

inspect dependencies for surrealdb

Analyze the terminal output to locate any version of Surrealdb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Surrealdb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A vulnerability was found where an attacker can crash the database via crafting a HTTP query that returns a null byte. The problem relies on an uncaught exception in the `net` module, where the result of the query will be converted to JSON before showing as the HTTP response to the user in the **/sql** endpoint. ### Impact This vulnerability allows any authenticated user to crash a SurrealDB instance by sending a crafted query with a null byte to the /sql endpoint. Where SurrealDB is used as an application backend, it is possible that an application user can crash the SurrealDB instance and thus the supported application through crafted inputs that exploit this attack vector. ### Patches A patch has been introduced that ensures the error is caught and converted as an error. - Versions 2.2.2, 2.1.5 and 2.0.5 and later are not affected by this isssue ### Workarounds Affected users who are unable to update may want to limit the ability of untrusted clients to run arbitrary queries in the affected versions of SurrealDB. To limit the impact of the denial of service, SurrealDB administrators may also want to ensure that the SurrealDB process is running so that it can be automatically re-started after a crash. Where SurrealDB is used as an application backend, ensure sanitisation of input at the application layer to prevent injection attacks. ### References https://github.com/surrealdb/surrealdb/pull/5647

GHSA-rq86-9m6r-cm3g Affected Surrealdb Versions

3 component(s)
Fixed Versions:
2.2.22.1.52.0.5
Product / Package Ecosystem Affected Versions Fixed Version
surrealdb
crates.io
≥ 2.2.0
< 2.2.2
2.2.2
surrealdb
crates.io
≥ 2.1.0
< 2.1.5
2.1.5
surrealdb
crates.io
< 2.0.5
2.0.5

References

Frequently Asked Questions

What is GHSA-rq86-9m6r-cm3g?
GHSA-rq86-9m6r-cm3g is a security vulnerability in Surrealdb involving SurrealDB has uncaught exception in Net module that leads to database crash under CWE-248: Uncaught Exception.
Which Surrealdb versions are affected?
Affected versions include releases prior to 2.2.2, 2.1.5, 2.0.5 across affected packages: surrealdb.
What version fixes GHSA-rq86-9m6r-cm3g?
Upgrading to 2.2.2, 2.1.5, 2.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is surrealdb affected?
Yes, surrealdb is affected in releases prior to 2.2.2, 2.1.5, 2.0.5. Upgrade your dependency to 2.2.2, 2.1.5, 2.0.5 or later.
What CWE is associated with GHSA-rq86-9m6r-cm3g?
GHSA-rq86-9m6r-cm3g is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check crates.io dependencies for GHSA-rq86-9m6r-cm3g?
Run the dependency tree command: 'inspect dependencies for surrealdb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rq86-9m6r-cm3g",
  "modified" : "2025-04-10T21:05:35Z",
  "published" : "2025-04-10T21:05:34Z",
  "aliases" : [ ],
  "summary" : "SurrealDB has uncaught exception in Net module that leads to database crash",
  "details" : "A vulnerability was found where an attacker can crash the database via crafting a HTTP query that returns a null byte. The problem relies on an uncaught exception in the `net` module, where the result of the query will be converted to JSON before showing as the HTTP response to the user in the **/sql** endpoint.\n\n### Impact\nThis vulnerability allows any authenticated user to crash a SurrealDB instance by sending a crafted query with a null byte to the /sql endpoint. \n\nWhere SurrealDB is used as an application backend, it is possible that an application user can crash the SurrealDB instance and thus the supported application through crafted inputs that exploit this attack vector.\n\n\n### Patches\nA patch has been introduced that ensures the error is caught and converted as an error.\n- Versions 2.2.2, 2.1.5 and 2.0.5 and later are not affected by this isssue\n\n### Workarounds\n\nAffected users who are unable to update may want to limit the ability of untrusted clients to run arbitrary queries in the affected versions of SurrealDB. To limit the impact of the denial of service, SurrealDB administrators may also want to ensure that the SurrealDB process is running so that it can be automatically re-started after a crash.\n\nWhere SurrealDB is used as an application backend, ensure sanitisation of input at the application layer to prevent injection attacks.\n\n### References\nhttps://github.com/surrealdb/surrealdb/pull/5647",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "surrealdb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.2.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "surrealdb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "surrealdb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-rq86-9m6r-cm3g"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/surrealdb/surrealdb/pull/5647"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/surrealdb/surrealdb"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-10T21:05:34Z",
    "nvd_published_at" : null
  }
}