GHSA-58j9-j2fj-v8f4: Surrealdb SurrealDB Vulnerable To Uncontrolled CPU Vulnerability

HIGH
CVSS 7.5
Published
Advisory Summary

GHSA-58j9-j2fj-v8f4 is a HIGH (CVSS 7.5) surrealdb vulnerable to uncontrolled cpu vulnerability (General Security Weakness) affecting Surrealdb libraries in the crates.io ecosystem. The issue involves surrealdb vulnerable to uncontrolled cpu consumption via websocket interface. Remediation is available by upgrading affected packages to version 1.1.0.

GHSA-58j9-j2fj-v8f4 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-58j9-j2fj-v8f4
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification General Security Weakness
Affected Product Surrealdb
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix GHSA-58j9-j2fj-v8f4

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: 1.1.0
Upgrade surrealdb to 1.1.0
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-58j9-j2fj-v8f4, 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 1.1.0), 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 General Security Weakness. 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

SurrealDB depends on the `tungstenite` and `tokio-tungstenite` crates used by the `axum` crate, which handles connections to the SurrealDB WebSocket interface. On versions before `0.20.1`, the `tungstenite` crate presented an issue which allowed the parsing of HTTP headers during the client handshake to continuously consume high CPU when the headers were very long. All affected crates have been updated in SurrealDB version `1.1.0`. From the original advisory for [CVE-2023-43669](https://nvd.nist.gov/vuln/detail/CVE-2023-43669): "The Tungstenite crate through 0.20.0 for Rust allows remote attackers to cause a denial of service (minutes of CPU consumption) via an excessive length of an HTTP header in a client handshake. The length affects both how many times a parse is attempted (e.g., thousands of times) and the average amount of data for each parse attempt (e.g., millions of bytes)." ### Impact A remote unauthenticated attacker may cause a SurrealDB server that exposes its WebSocket interface to consume high CPU by sending an HTTP request with a very long header to the WebSocket interface, potentially leading to denial of service. ### Patches - Version 1.1.0 and later are not affected by this issue. ### Workarounds Users unable to update may be able to limit access to the WebSocket interface (i.e. the `/rpc` endpoint) via reverse proxy if not in use or only used by a limited number of trusted clients. Alternatively, a reverse proxy may be used to strip or truncate request headers exceeding a reasonable length before reaching the SurrealDB server. ### References - #2807 - https://nvd.nist.gov/vuln/detail/CVE-2023-43669 - https://rustsec.org/advisories/RUSTSEC-2023-0065.html - https://github.com/snapview/tungstenite-rs/issues/376

GHSA-58j9-j2fj-v8f4 Affected Surrealdb Versions

1 component(s)
Fixed Versions:
1.1.0
Product / Package Ecosystem Affected Versions Fixed Version
surrealdb
crates.io
< 1.1.0
1.1.0

References

Frequently Asked Questions

What is GHSA-58j9-j2fj-v8f4?
GHSA-58j9-j2fj-v8f4 is a security vulnerability in Surrealdb involving SurrealDB vulnerable to Uncontrolled CPU Consumption via WebSocket Interface under General Security Weakness.
Which Surrealdb versions are affected?
Affected versions include releases prior to 1.1.0 across affected packages: surrealdb.
What version fixes GHSA-58j9-j2fj-v8f4?
Upgrading to 1.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is surrealdb affected?
Yes, surrealdb is affected in releases prior to 1.1.0. Upgrade your dependency to 1.1.0 or later.
What is the CVSS score of GHSA-58j9-j2fj-v8f4?
GHSA-58j9-j2fj-v8f4 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with GHSA-58j9-j2fj-v8f4?
GHSA-58j9-j2fj-v8f4 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-58j9-j2fj-v8f4?
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-58j9-j2fj-v8f4",
  "modified" : "2024-01-19T20:31:21Z",
  "published" : "2024-01-19T20:31:21Z",
  "aliases" : [ ],
  "summary" : "SurrealDB vulnerable to Uncontrolled CPU Consumption via WebSocket Interface",
  "details" : "SurrealDB depends on the `tungstenite` and `tokio-tungstenite` crates used by the `axum` crate, which handles connections to the SurrealDB WebSocket interface. On versions before `0.20.1`, the `tungstenite` crate presented an issue which allowed the parsing of HTTP headers during the client handshake to continuously consume high CPU when the headers were very long. All affected crates have been updated in SurrealDB version `1.1.0`.\n\nFrom the original advisory for [CVE-2023-43669](https://nvd.nist.gov/vuln/detail/CVE-2023-43669):\n\"The Tungstenite crate through 0.20.0 for Rust allows remote attackers to cause a denial of service (minutes of CPU consumption) via an excessive length of an HTTP header in a client handshake. The length affects both how many times a parse is attempted (e.g., thousands of times) and the average amount of data for each parse attempt (e.g., millions of bytes).\"\n\n### Impact\n\nA remote unauthenticated attacker may cause a SurrealDB server that exposes its WebSocket interface to consume high CPU by sending an HTTP request with a very long header to the WebSocket interface, potentially leading to denial of service.\n\n### Patches\n\n- Version 1.1.0 and later are not affected by this issue.\n\n### Workarounds\n\nUsers unable to update may be able to limit access to the WebSocket interface (i.e. the `/rpc` endpoint) via reverse proxy if not in use or only used by a limited number of trusted clients. Alternatively, a reverse proxy may be used to strip or truncate request headers exceeding a reasonable length before reaching the SurrealDB server.\n\n### References\n\n- #2807\n- https://nvd.nist.gov/vuln/detail/CVE-2023-43669\n- https://rustsec.org/advisories/RUSTSEC-2023-0065.html\n- https://github.com/snapview/tungstenite-rs/issues/376",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "surrealdb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-58j9-j2fj-v8f4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-43669"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snapview/tungstenite-rs/issues/376"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/surrealdb/surrealdb/pull/2807"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/surrealdb/surrealdb/commit/87859158d3750b03564613de70b5ec4ae090549d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/surrealdb/surrealdb"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0065.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-19T20:31:21Z",
    "nvd_published_at" : null
  }
}