{"id":"CVE-2026-63733","aliases":["EUVD-2026-45904","GHSA-66r2-5gwj-gxm2","GHSA-6g69-7xmf-h2x7"],"status":"published","title":"SurrealDB before 3.2.0 Permissions Bypass via PERMISSIONS Clause","description":"SurrealDB versions before 3.2.0 contain a permissions bypass vulnerability where data-modifying statements within PERMISSIONS clauses execute with enforcement disabled. Attackers with permission to perform a guarded operation can write to tables they lack permission for by embedding CREATE, UPDATE, DELETE, or UPSERT statements in the PERMISSIONS clause, causing unintended writes and data corruption.","severity":{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00287,"percentile":0.21471,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-863"],"published":"2026-07-20T12:04:30Z","modified":"2026-11-04T02:47:48Z","fixes":[{"ecosystem":"crates.io","package":"surrealdb-core","fixed_in":["3.2.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"surrealdb-core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.2.0"}]}]},{"source":"osv","ecosystem":"crates.io","package":"surrealdb-core","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.2.0"}]}]}],"products":[{"vendor":"surrealdb","product":"surrealdb"}],"references":[{"url":"https://github.com/surrealdb/surrealdb/security/advisories/GHSA-66r2-5gwj-gxm2","tags":["vendor-advisory","Vendor Advisory","Mitigation","advisory","web"]},{"url":"https://www.vulncheck.com/advisories/surrealdb-before-permissions-bypass-via-permissions-clause","tags":["third-party-advisory","Third Party Advisory","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63733","tags":["advisory"]},{"url":"https://github.com/surrealdb/surrealdb/commit/1e4c3d743e1591f14f340cb627e56d98b6bd7fd7","tags":["web"]},{"url":"https://github.com/surrealdb/surrealdb/commit/afea699dfb3c8f274ab36861f8a95f5e98d82f1b","tags":["web"]},{"url":"https://github.com/surrealdb/surrealdb/releases/tag/v3.2.0","tags":["web"]},{"url":"https://github.com/advisories/GHSA-66r2-5gwj-gxm2"},{"url":"https://github.com/advisories/GHSA-6g69-7xmf-h2x7"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/63xxx/CVE-2026-63733.json","tags":["advisory"]},{"url":"https://github.com/surrealdb/surrealdb","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-63733","title":"SurrealDB before 3.2.0 Permissions Bypass via PERMISSIONS Clause","description":"SurrealDB versions before 3.2.0 contain a permissions bypass vulnerability where data-modifying statements within PERMISSIONS clauses execute with enforcement disabled. Attackers with permission to perform a guarded operation can write to tables they lack permission for by embedding CREATE, UPDATE, DELETE, or UPSERT statements in the PERMISSIONS clause, causing unintended writes and data corruption.","status":"published","published":"2026-07-20T12:04:30.055Z","modified":"2026-07-28T01:05:31.722Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium","assessor":"cna"},{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T14:19:55.914391Z"}],"euvd":[{"id":"EUVD-2026-45904","description":"SurrealDB versions before 3.2.0 contain a permissions bypass vulnerability where data-modifying statements within PERMISSIONS clauses execute with enforcement disabled. Attackers with permission to perform a guarded operation can write to tables they lack permission for by embedding CREATE, UPDATE, DELETE, or UPSERT statements in the PERMISSIONS clause, causing unintended writes and data corruption.","status":"published","published":"2026-07-20T12:04:30Z","modified":"2026-07-28T01:05:31Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"updated_at":"2026-11-02T18:02:33.420584Z"}],"ghsa":[{"id":"GHSA-66r2-5gwj-gxm2","title":"SurrealDB: Writes in a PERMISSIONS clause bypass table permissions","description":"A `PERMISSIONS ... WHERE` clause is evaluated with permission enforcement disabled, so it can't recurse into its own checks. But the clause could also contain data-modifying statements, and these ran with enforcement still off — so evaluating a permission check could write to tables the caller cannot write.\n\nFor example:\n\n```surql\nDEFINE TABLE post PERMISSIONS FOR update\n    WHERE (CREATE log SET at = time::now()) OR true;\n```\n\nAny user allowed to update a `post` now also creates a `log` record, even with no permission on `log`. The clause is evaluated once per matched record, so one statement can cause several writes.\n\n### Impact\n\nOnly databases with a `PERMISSIONS` clause that contains a write are affected; `FULL`, `NONE`, and read-only clauses are not.\n\nWhat an attacker **can** do:\n\n- With permission to perform the guarded operation (a low-privileged or record user is enough), write to tables in their own database that their permissions would otherwise forbid, by triggering an operation the clause guards.\n- Cause several writes from a single statement — the clause is evaluated once per matched record.\n- Trigger unintended events, cascades, or data corruption on those tables.\n\nWhat it **can't** do:\n\n- Escape the caller's own namespace and database — a permission clause cannot switch namespace or database.\n- Perform root- or namespace-level actions such as creating users; the caller's role still applies.\n- Read hidden data — this is an integrity issue, not disclosure.\n\n### Patches\n\nPermission clauses must now be read-only: defining or importing one that contains a write is rejected, and any write attempted while a clause is evaluated is blocked at runtime, including writes reached through a called function. Read-only clauses are unaffected.\n\n- Versions 3.2.0 and later are not affected by this issue.\n\n### Workarounds\n\nUsers unable to patch should consider the following workarounds:\n\n- Review your `PERMISSIONS` clauses and remove any containing `CREATE`, `UPDATE`, `DELETE`, `RELATE`, `INSERT`, or `UPSERT`.\n- Limit who can define schema and vet imported data — such a clause must be defined before it can be triggered.\n\n### Resources\n\n- [DEFINE TABLE … PERMISSIONS](https://surrealdb.com/docs/surrealql/statements/define/table)\n- [DEFINE FIELD](https://surrealdb.com/docs/surrealql/statements/define/field)\n- `fix(core): reject writes in PERMISSIONS clauses and block writes during permission evaluation` (included in SurrealDB 3.2.0)\n\n### Acknowledgements\n\nThank you to [sondt99](https://github.com/sondt99) for reporting this issue.","status":"published","published":"2026-09-04T20:50:40Z","modified":"2026-09-04T20:50:41Z","cvss":[{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T14:41:12.487077Z"},{"id":"GHSA-6g69-7xmf-h2x7","title":"Duplicate Advisory: Writes in a PERMISSIONS clause bypass table permissions","description":"## Duplicate Advisory\n\nThis advisory has been withdrawn because it is a duplicate of GHSA-66r2-5gwj-gxm2. This link is maintained to preserve external references.\n\n## Original Description\nSurrealDB versions before 3.2.0 contain a permissions bypass vulnerability where data-modifying statements within PERMISSIONS clauses execute with enforcement disabled. Attackers with permission to perform a guarded operation can write to tables they lack permission for by embedding CREATE, UPDATE, DELETE, or UPSERT statements in the PERMISSIONS clause, causing unintended writes and data corruption.","status":"withdrawn","published":"2026-07-20T12:33:08Z","modified":"2026-09-04T20:49:44Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium"},{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T14:41:12.487077Z"}],"nvd":[{"id":"CVE-2026-63733","description":"SurrealDB versions before 3.2.0 contain a permissions bypass vulnerability where data-modifying statements within PERMISSIONS clauses execute with enforcement disabled. Attackers with permission to perform a guarded operation can write to tables they lack permission for by embedding CREATE, UPDATE, DELETE, or UPSERT statements in the PERMISSIONS clause, causing unintended writes and data corruption.","status":"published","published":"2026-07-20T12:19:42.243Z","modified":"2026-07-22T15:53:24.56Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium","assessor":"secondary"},{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T14:12:31.024898Z"}],"osv":[{"id":"CVE-2026-63733","title":"SurrealDB before 3.2.0 Permissions Bypass via PERMISSIONS Clause","description":"SurrealDB versions before 3.2.0 contain a permissions bypass vulnerability where data-modifying statements within PERMISSIONS clauses execute with enforcement disabled. Attackers with permission to perform a guarded operation can write to tables they lack permission for by embedding CREATE, UPDATE, DELETE, or UPSERT statements in the PERMISSIONS clause, causing unintended writes and data corruption.","status":"published","published":"2026-07-20T12:04:30.055Z","modified":"2026-11-04T02:47:48.524239374Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"cwes":["CWE-863"],"updated_at":"2026-11-04T02:53:00.786919Z"},{"id":"GHSA-66r2-5gwj-gxm2","title":"SurrealDB: Writes in a PERMISSIONS clause bypass table permissions","description":"A `PERMISSIONS ... WHERE` clause is evaluated with permission enforcement disabled, so it can't recurse into its own checks. But the clause could also contain data-modifying statements, and these ran with enforcement still off — so evaluating a permission check could write to tables the caller cannot write.\n\nFor example:\n\n```surql\nDEFINE TABLE post PERMISSIONS FOR update\n    WHERE (CREATE log SET at = time::now()) OR true;\n```\n\nAny user allowed to update a `post` now also creates a `log` record, even with no permission on `log`. The clause is evaluated once per matched record, so one statement can cause several writes.\n\n### Impact\n\nOnly databases with a `PERMISSIONS` clause that contains a write are affected; `FULL`, `NONE`, and read-only clauses are not.\n\nWhat an attacker **can** do:\n\n- With permission to perform the guarded operation (a low-privileged or record user is enough), write to tables in their own database that their permissions would otherwise forbid, by triggering an operation the clause guards.\n- Cause several writes from a single statement — the clause is evaluated once per matched record.\n- Trigger unintended events, cascades, or data corruption on those tables.\n\nWhat it **can't** do:\n\n- Escape the caller's own namespace and database — a permission clause cannot switch namespace or database.\n- Perform root- or namespace-level actions such as creating users; the caller's role still applies.\n- Read hidden data — this is an integrity issue, not disclosure.\n\n### Patches\n\nPermission clauses must now be read-only: defining or importing one that contains a write is rejected, and any write attempted while a clause is evaluated is blocked at runtime, including writes reached through a called function. Read-only clauses are unaffected.\n\n- Versions 3.2.0 and later are not affected by this issue.\n\n### Workarounds\n\nUsers unable to patch should consider the following workarounds:\n\n- Review your `PERMISSIONS` clauses and remove any containing `CREATE`, `UPDATE`, `DELETE`, `RELATE`, `INSERT`, or `UPSERT`.\n- Limit who can define schema and vet imported data — such a clause must be defined before it can be triggered.\n\n### Resources\n\n- [DEFINE TABLE … PERMISSIONS](https://surrealdb.com/docs/surrealql/statements/define/table)\n- [DEFINE FIELD](https://surrealdb.com/docs/surrealql/statements/define/field)\n- `fix(core): reject writes in PERMISSIONS clauses and block writes during permission evaluation` (included in SurrealDB 3.2.0)\n\n### Acknowledgements\n\nThank you to [sondt99](https://github.com/sondt99) for reporting this issue.","status":"published","published":"2026-09-04T20:50:40Z","modified":"2026-09-04T21:10:34.732142Z","cvss":[{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T15:46:39.266402Z"},{"id":"GHSA-6g69-7xmf-h2x7","title":"Duplicate Advisory: Writes in a PERMISSIONS clause bypass table permissions","description":"## Duplicate Advisory\n\nThis advisory has been withdrawn because it is a duplicate of GHSA-66r2-5gwj-gxm2. This link is maintained to preserve external references.\n\n## Original Description\nSurrealDB versions before 3.2.0 contain a permissions bypass vulnerability where data-modifying statements within PERMISSIONS clauses execute with enforcement disabled. Attackers with permission to perform a guarded operation can write to tables they lack permission for by embedding CREATE, UPDATE, DELETE, or UPSERT statements in the PERMISSIONS clause, causing unintended writes and data corruption.","status":"withdrawn","published":"2026-07-20T12:33:08Z","modified":"2026-09-04T21:00:06.712057452Z","cvss":[{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium"},{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T15:46:39.618611Z"}]}}
