Skip to content
surrealdbGHSA-4vgr-h27g-cf9p

SurrealDB: HTTP RPC Session Race Condition Allows Privilege Escalation

High8.1Published Jul 1, 2026

GitHub advisory

Affected versions

PackageAffectedFixed in
surrealdb
crates.io
< 3.1.03.1.0
Details and references

The HTTP `/rpc` endpoint has a time-of-check/time-of-use (TOCTOU) race condition on internal session state. When authenticated and unauthenticated requests are processed concurrently, the unauthenticated request can inherit the authenticated user's session and privileges. The `/rpc` endpoint is the primary interface used by all official SurrealDB SDKs. The HTTP `/rpc` handler does not bind each incoming request to an isolated session context. Instead, concurrent requests share mutable authentication state. When an authenticated request sets the session context and an unauthenticated request races in before it is cleared, the unauthenticated request executes with the authenticated user's privileges. The impact depends on the privilege level of the session that is hijacked. If a root or namespace-level user session is inherited, the attacker can read and modify any data, delete records, and create persistent namespace-level users. If a scoped record user session is inherited, the attacker is limited to that user's permissions. The attack requires no credentials, tokens, or session knowledge , only the ability to send concurrent HTTP requests to the `/rpc` endpoint while legitimate authenticated traffic is active. ## Impact An unauthenticated attacker who can reach the `/rpc` endpoint can escalate privileges by racing against any active authenticated session. The severity of the impact depends on the permissions of the user whose session was hijacked. This could include escalation to root user of SurrealDB instance ## Patches Versions prior to SurrealDB `v3.1.0` are vulnerable. A patch has been introduced that replaces the shared default session with per-request session isolation. Every `POST /rpc` request now allocates a fresh, server-side UUID and runs entirely within that session's scope for the duration of the request. The session-map signatures across the RPC protocol have been changed from `Option<Uuid>` to `Uuid` so the "default session" can no longer be represented at the type level, preventing future regressions of the same shape. ## Workarounds There is no configuration-level mitigation that fully addresses this vulnerability. Network-level controls restricting access to the `/rpc` endpoint to trusted clients can reduce exposure.

CVSS 3.1
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Severity from
GitHub (reviewed advisory)
Weakness
CWE-362

More surrealdb advisories

All
DateAdvisory
Jul 1SurrealDB: HTTP /rpc `sessions` method leaks attached session UUIDs, enabling full session hijack by anonymous callers
GHSA-5qfp-32cf-69jhHigh8.8fixed in 3.1.0
Jul 1SurrealDB has Denial of Service in JSON parser due to nested objects
CVE-2026-63760High7.5fixed in 3.1.0
Jul 1SurrealDB has unauthenticated remote DoS via malformed RPC `use` call
GHSA-wjjj-24cx-f28gHigh7.5fixed in 3.1.0
Jul 1SurrealDB vulnerable to Denial of Service due to nested types annotations
GHSA-q8qp-67f9-wr3fMedium6.5fixed in 3.1.0
Jul 1SurrealDB: Scraping a TABLE with no available PERMISSIONS to current auth level
CVE-2026-63755Medium6.5fixed in 3.1.0
Jul 1SurrealDB: Graph traversal bypasses table SELECT permissions
CVE-2026-63746Medium6.5fixed in 3.1.0

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.