GHSA-wjjj-24cx-f28g

Suggest an improvement
Source
https://github.com/advisories/GHSA-wjjj-24cx-f28g
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-wjjj-24cx-f28g/GHSA-wjjj-24cx-f28g.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-wjjj-24cx-f28g
Published
2026-07-01T20:04:22Z
Modified
2026-07-01T20:15:09Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
SurrealDB has unauthenticated remote DoS via malformed RPC `use` call
Details

A single unauthenticated WebSocket message to /rpc crashed the SurrealDB server. Sending use { db: "x" } without first selecting a namespace hit .expect("namespace should be set") in the use handler; because surrealdb-core is built with panic = 'abort', the panic terminated the process. use is callable before signin, and the per-method capability check passes by default for guest callers — so no credentials, token, or --allow-guests flag are required.

Impact

An unauthenticated remote attacker who could reach the /rpc endpoint could crash the SurrealDB server with a single WebSocket message. No credentials, token, session knowledge, or capability are required.

Patches

A patch has been introduced that returns a typed invalid_params response when db is set on a session with no ns, replacing the panic.

  • Versions 3.1.0 and later are not affected by this issue.

Workarounds

Affected users who are unable to update should restrict network access to the /rpc endpoint to trusted clients, and run SurrealDB under a process supervisor that restarts on crash.

Database specific
{
    "cwe_ids":  [
        "CWE-248",
        "CWE-754"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-07-01T20:04:22Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

crates.io / surrealdb

Package

Name
surrealdb
View open source insights on deps.dev
Purl
pkg:cargo/surrealdb

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
3.1.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-wjjj-24cx-f28g/GHSA-wjjj-24cx-f28g.json"