GHSA-5QFP-32CF-69JH
Vulnerability from github – Published: 2026-07-01 20:00 – Updated: 2026-07-01 20:00The 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.
{
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "surrealdb"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.1.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-384"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-01T20:00:17Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "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.\n\n\"Attached\" means sessions registered via `{\"method\":\"attach\"}` \u2014 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.\n\n### Exposure\n\n- **Exposed:** clients that issue `attach`, notably the official Rust SDK\u0027s `Http`/`Https` engine (auto-attaches once per `Surreal` handle).\n- **Not exposed:** REST endpoints (`/sql`, `/key`, `/signin`, `/export`, etc.); WebSocket `/rpc` (per-connection scope, `attach` refused); embedded / MCP usage; ad-hoc `POST /rpc` callers that never `attach`.\n\n### Impact\n\nFor 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\u0027s privilege level (up to root). An attached session that has not yet authenticated is `Level::No` and confers no privilege.\n\n### Patches\n\n1. HTTP `sessions()` now returns `method_not_allowed`. WebSocket retains per-connection enumeration.\n2. The HTTP `/rpc` handler gates client-supplied session IDs against the caller\u0027s request-level auth principal (actor id + level); mismatches return `session_not_found`.\n3. Attached HTTP sessions are capped via `SURREAL_HTTP_MAX_ATTACHED_SESSIONS`.\n\nVersions 3.1.0 and later are not affected.\n\n### Workarounds\n\nNo configuration-level mitigation fully addresses this. For Users unable to upgrade:\n\n- Avoid SDKs and client flows that call `attach` against HTTP `/rpc` (notably the Rust SDK\u0027s `Http`/`Https` engine). Prefer the WebSocket transport, or REST endpoints (`/sql`, `/signin`, `/key`, `/export`) which never populate the attached-session map.\n- Restrict `/rpc` to trusted clients at the network layer.",
"id": "GHSA-5qfp-32cf-69jh",
"modified": "2026-07-01T20:00:17Z",
"published": "2026-07-01T20:00:17Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-5qfp-32cf-69jh"
},
{
"type": "WEB",
"url": "https://github.com/surrealdb/surrealdb/commit/fd800fc7c55afcdc97057d18cf7cb7f83557e702"
},
{
"type": "PACKAGE",
"url": "https://github.com/surrealdb/surrealdb"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "SurrealDB: HTTP /rpc `sessions` method leaks attached session UUIDs, enabling full session hijack by anonymous callers"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.