{"id":"CVE-2026-63755","aliases":["CVE-2026-63755","GHSA-98fx-66cf-fc7c"],"related":[],"kind":"vulnerability","state":"published","title":"SurrealDB before 3.1.0 Permission Bypass via WHERE Clause","summary":"SurrealDB before 3.1.0 evaluates user-supplied WHERE clauses in SELECT statements (and SET/MERGE/CONTENT/PATCH clauses in UPDATE, UPSERT, INSERT ON DUPLICATE KEY UPDATE, and RELATE update-variant statements) against full record data before enforcing PERMISSIONS FOR SELECT WHERE restrictions. An authenticated user — including Record and Scope users — can exploit this ordering flaw to read the full contents of any table in the database they are authenticated against, bypassing table-level permission checks. Exfiltration is most direct when scripting functions are enabled (--allow-scripting), but is also possible via SurrealQL's THROW statement and timing-based side channels without scripting. The vulnerability is confined to the attacker's current database and does not cross namespace or database isolation boundaries.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SurrealDB before 3.1.0 evaluates user-supplied WHERE clauses in SELECT statements (and SET/MERGE/CONTENT/PATCH clauses in UPDATE, UPSERT, INSERT ON DUPLICATE KEY UPDATE, and RELATE update-variant statements) against full record data before enforcing PERMISSIONS FOR SELECT WHERE restrictions. An authenticated user — including Record and Scope users — can exploit this ordering flaw to read the full contents of any table in the database they are authenticated against, bypassing table-level permission checks. Exfiltration is most direct when scripting functions are enabled (--allow-scripting), but is also possible via SurrealQL's THROW statement and timing-based side channels without scripting. The vulnerability is confined to the attacker's current database and does not cross namespace or database isolation boundaries.","source":"cvelist"},{"lang":"en","text":"A vulnerability was discovered where the user-supplied `WHERE` clause in a `SELECT` statement is evaluated against the full record data before `PERMISSIONS FOR SELECT WHERE` determines whether the principal is authorised to access that record. A side-effecting expression in the `WHERE` clause can exfiltrate record contents before the permission check runs. The same ordering bug affects the `SET`, `MERGE`, `CONTENT` and `PATCH` clauses of update-variant statements (`UPDATE`, `UPSERT-update`, `INSERT ON DUPLICATE KEY UPDATE`, `RELATE-update`).\n\nThis vulnerability is confined to the attacker's current database. It does not cross namespace or database isolation boundaries.\n\n### Impact\n\nAn authenticated user — including Record and Scope users — can read the full contents of any table in the database they are authenticated against, bypassing `PERMISSIONS FOR SELECT WHERE` restrictions on those tables.\n\nThe most direct exfiltration method requires scripting functions to be enabled (`--allow-scripting` / `-A`). However, exfiltration via SurrealQL's `THROW` statement is also feasible without scripting functions, and timing-based side-channel extraction is possible in all configurations.\n\nAll tables within the attacker's current database, regardless of table-level `PERMISSIONS FOR SELECT WHERE` restrictions on those tables, are vulnerable to this attack. Tables in other databases within the same namespace, or within other namespaces, are not vulnerable.\n\n### Patches\n\nA patch has been introduced that runs `check_permissions_table` before any user-supplied expression is evaluated against the record. A new `check_pre_update` helper centralises this ordering on every update-variant code path. Regression tests covering `WHERE`, `SET`, `MERGE`, `CONTENT`, `INSERT ON DUPLICATE KEY UPDATE`, and `RELATE` with `THROW` side-effects are included.\n\n- Versions 3.1.0 and later are not affected by this issue.\n\n### Workarounds\n\nAffected users who are unable to update may want to:\n\n- **Disable scripting functions** if not required — remove the `-A` / `--allow-scripting` flag. This blocks the most direct exfiltration method but does not fully mitigate the vulnerability, as `THROW`-based and timing-based exfiltration remain possible.\n- **Limit query access** — restrict the ability of untrusted principals to run arbitrary `SELECT` queries with user-controlled `WHERE` clauses.\n- **Use namespace/database isolation** instead of table-level permissions as the primary security boundary where feasible, since the vulnerability is in table-level permission enforcement, not namespace or database isolation.","format":"markdown","source":"ghsa"}],"published":"2026-07-01T20:06:08.000Z","modified":"2026-10-08T15:23:50.053Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":7.1,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-863"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"3.1.0","status":"affected"},{"type":"semver","version":"3.1.0","status":"unaffected"}],"vendor":"surrealdb","product":"surrealdb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.1.0"}],"ecosystem":"crates.io","package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.0"}],"vendor":"surrealdb","product":"surrealdb","cpe":"cpe:2.3:a:surrealdb:surrealdb:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/surrealdb/surrealdb/security/advisories/GHSA-98fx-66cf-fc7c","tags":["mitigation","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/surrealdb-before-permission-bypass-via-where-clause","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63755","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/surrealdb/surrealdb/commit/500f4060349580b9cbb9c07b8112a487551c4616","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/surrealdb/surrealdb","tags":["package"],"sources":["ghsa"]}],"credits":["LucyEgan"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-20T13:47:26.470Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-63755","url":"https://www.cve.org/CVERecord?id=CVE-2026-63755","licence":"CVE Terms of Use","modified":"2026-10-08T15:23:50.053Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-98fx-66cf-fc7c","url":"https://github.com/advisories/GHSA-98fx-66cf-fc7c","licence":"CC-BY-4.0","modified":"2026-09-04T20:40:32.892Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-63755","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63755","licence":"Public domain","modified":"2026-07-22T15:19:27.620Z"}],"updatedAt":"2026-11-25T22:59:29.210Z","epss":{"score":0.0021,"percentile":0.11874,"date":"2026-12-01T12:00:22.000Z"}}