# GHSA-wjjj-24cx-f28g: SurrealDB has unauthenticated remote DoS via malformed RPC `use` call

> Unauthenticated remote attackers can crash the SurrealDB server by sending a malformed RPC message, causing a denial of service.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jul 2026

## What is GHSA-wjjj-24cx-f28g?

GHSA-wjjj-24cx-f28g is a denial of service vulnerability in surrealdb, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

## Which versions are affected by GHSA-wjjj-24cx-f28g?

2 open source packages ship an affected version, including surrealdb.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `surrealdb` | crates.io | All versions | 3.1.0 |
| `surrealdb` | crates.io | All versions | 3.1.0 |

## How do I fix GHSA-wjjj-24cx-f28g?

Upgrade surrealdb to 3.1.0 or later.

## Is GHSA-wjjj-24cx-f28g being exploited?

There is no known exploitation of GHSA-wjjj-24cx-f28g in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-wjjj-24cx-f28g and fix it if it is affected.

What it is: GHSA-wjjj-24cx-f28g is a denial of service vulnerability in surrealdb, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-wjjj-24cx-f28g in the wild and no public exploit code.

Affected packages and fixed versions:
- surrealdb (crates.io): affected all versions; fixed in 3.1.0
- surrealdb (crates.io): affected all versions; fixed in 3.1.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-wjjj-24cx-f28g/ (Markdown: https://insights.sbomify.com/GHSA-wjjj-24cx-f28g/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-wjjj-24cx-f28g

---
From sbomify Insights: https://insights.sbomify.com/GHSA-wjjj-24cx-f28g/
Summaries are generated and may contain mistakes; the official description above is the record.
