GHSA-5qfp-32cf-69jh SurrealDB: HTTP /rpc `sessions` method leaks attached session UUIDs, enabling full session hijack by anonymous callers
Unauthenticated attackers can hijack attached HTTP sessions in SurrealDB to read, write, and delete data or escalate privileges.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-5qfp-32cf-69jh?
GHSA-5qfp-32cf-69jh is an authentication bypass 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
The HTTP /rpc sessions method returned every attached session UUID without authentication, and the /rpc handler accepted an arbitrary session field with no ownership check. An anonymous caller could enumerate UUIDs and impersonate any authenticated session.
"Attached" means sessions registered via {"method":"attach"} — the only writer to the HTTP session map. Ordinary stateless /rpc requests use ephemeral per-request sessions that are filtered from sessions() and destroyed at end-of-request, so they are not enumerable.
Exposure
- Exposed: clients that issue
attach, notably the official Rust SDK'sHttp/Httpsengine (auto-attaches once perSurrealhandle). - Not exposed: REST endpoints (
/sql,/key,/signin,/export, etc.); WebSocket/rpc(per-connection scope,attachrefused); embedded / MCP usage; ad-hocPOST /rpccallers that neverattach.
Impact
For each attached and authenticated session, an unauthenticated attacker can read, write, and delete any data the session can reach, dump metadata, invalidate sessions, and escalate to that session's privilege level (up to root). An attached session that has not yet authenticated is Level::No and confers no privilege.
Patches
- HTTP
sessions()now returnsmethod_not_allowed. WebSocket retains per-connection enumeration. - The HTTP
/rpchandler gates client-supplied session IDs against the caller's request-level auth principal (actor id + level); mismatches returnsession_not_found. - Attached HTTP sessions are capped via
SURREAL_HTTP_MAX_ATTACHED_SESSIONS.
Versions 3.1.0 and later are not affected.
Workarounds
No configuration-level mitigation fully addresses this. For Users unable to upgrade:
- Avoid SDKs and client flows that call
attachagainst HTTP/rpc(notably the Rust SDK'sHttp/Httpsengine). Prefer the WebSocket transport, or REST endpoints (/sql,/signin,/key,/export) which never populate the attached-session map. - Restrict
/rpcto trusted clients at the network layer.
Which versions are affected by GHSA-5qfp-32cf-69jh?
2 open source packages ship an affected version, including surrealdb.
| Package | Affected | Fixed in |
|---|---|---|
surrealdb crates.io | All versions | 3.1.0 |
surrealdb crates.io | All versions | 3.1.0 |
How do I fix GHSA-5qfp-32cf-69jh?
Upgrade surrealdb to 3.1.0 or later.
Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.
Is GHSA-5qfp-32cf-69jh being exploited?
There is no known exploitation of GHSA-5qfp-32cf-69jh in the wild and no public exploit code.