GHSA-5qfp-32cf-69jh: SurrealDB HTTP /rpc `sessions` Method Leaks Vulnerability
HIGHGHSA-5qfp-32cf-69jh is a HIGH (CVSS 8.8) http /rpc `sessions` method leaks vulnerability (CWE-384: Session Fixation) affecting SurrealDB libraries in the crates.io ecosystem. The issue involves http /rpc `sessions` method leaks attached session uuids, enabling full session hijack by anonymous callers. Remediation is available by upgrading affected packages to version 3.1.0.
GHSA-5qfp-32cf-69jh at a Glance
Security Impact
CVSS: 8.8
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:R/S:U/C:H/I:H/A:H).
How to Fix GHSA-5qfp-32cf-69jh
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.
Upgrade surrealdb to 3.1.0
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-5qfp-32cf-69jh, 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 3.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 CWE-384: Session Fixation, where authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions. 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
GHSA-5qfp-32cf-69jh Affected SurrealDB Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
surrealdb
|
crates.io |
< 3.1.0
|
3.1.0
|
References
Frequently Asked Questions
What is GHSA-5qfp-32cf-69jh?
Which SurrealDB versions are affected?
What version fixes GHSA-5qfp-32cf-69jh?
Is surrealdb affected?
What is the CVSS score of GHSA-5qfp-32cf-69jh?
What CWE is associated with GHSA-5qfp-32cf-69jh?
How can I check crates.io dependencies for GHSA-5qfp-32cf-69jh?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5qfp-32cf-69jh",
"modified" : "2026-07-01T20:00:17Z",
"published" : "2026-07-01T20:00:17Z",
"aliases" : [ ],
"summary" : "SurrealDB: HTTP /rpc `sessions` method leaks attached session UUIDs, enabling full session hijack by anonymous callers",
"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\"}` — 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's `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's 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's 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's `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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.0"
} ]
} ]
} ],
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-384" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-01T20:00:17Z",
"nvd_published_at" : null
}
}