{"answers":{"affected":"2 open source packages ship an affected version, including surrealdb.","exploited":"There is no known exploitation of GHSA-5qfp-32cf-69jh in the wild and no public exploit code.","fix":"Upgrade surrealdb to 3.1.0 or later.","what":"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."},"fix_prompt":"Check this codebase for GHSA-5qfp-32cf-69jh and fix it if it is affected.\n\nWhat it is: 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.\nExploitation: There is no known exploitation of GHSA-5qfp-32cf-69jh in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- surrealdb (crates.io): affected all versions; fixed in 3.1.0\n- surrealdb (crates.io): affected all versions; fixed in 3.1.0\n\nTask:\n1. 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.\n2. 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.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-5qfp-32cf-69jh/ (Markdown: https://insights.sbomify.com/GHSA-5qfp-32cf-69jh/index.md)","id":"GHSA-5qfp-32cf-69jh","markdown":"https://insights.sbomify.com/GHSA-5qfp-32cf-69jh/index.md","name":"GHSA-5qfp-32cf-69jh","record":{"aliases":[],"analysis":{"component_type":"database","fix_type":"upgrade","impacts":["privilege_escalation","data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"SurrealDB database","requires_auth":"none","summary":"Unauthenticated attackers can hijack attached HTTP sessions in SurrealDB to read, write, and delete data or escalate privileges.","user_interaction":"not_required","vuln_class":"auth_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"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.\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.","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"SurrealDB: HTTP /rpc `sessions` method leaks attached session UUIDs, enabling full session hijack by anonymous callers","id":"GHSA-5qfp-32cf-69jh","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"auth_bypass","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["3.1.0"],"introduced":["0"],"last_affected":[],"package":"surrealdb","purl":null,"source":"GHSA-5qfp-32cf-69jh"},{"ecosystem":"crates.io","fixed":["3.1.0"],"introduced":["0"],"last_affected":[],"package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"GHSA-5qfp-32cf-69jh"}],"products":null,"published":"2026-07-01","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Unauthenticated attackers can hijack attached HTTP sessions in SurrealDB to read, write, and delete data or escalate privileges.","url":"https://insights.sbomify.com/GHSA-5qfp-32cf-69jh/"}