CVE-2026-63733: SurrealDB: Writes in a PERMISSIONS clause bypass table permissions
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. For example: Any user allowed to update a post now also creates a log record, even with no permission on log.
Published Sep 4, 2026
Affected packages
surrealdb-core
- Ecosystem
- Rust (crates.io)
- Affected
- < 3.2.0
- Fixed in
- 3.2.0
- Check
cargo tree -i surrealdb-core
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
For example:
DEFINE TABLE post PERMISSIONS FOR update
WHERE (CREATE log SET at = time::now()) OR true;Any 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.
Impact
Only databases with a PERMISSIONS clause that contains a write are affected; FULL, NONE, and read-only clauses are not.
What an attacker can do:
- 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.
- Cause several writes from a single statement — the clause is evaluated once per matched record.
- Trigger unintended events, cascades, or data corruption on those tables.
What it can't do:
- Escape the caller's own namespace and database — a permission clause cannot switch namespace or database.
- Perform root- or namespace-level actions such as creating users; the caller's role still applies.
- Read hidden data — this is an integrity issue, not disclosure.
Patches
Permission 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.
- Versions 3.2.0 and later are not affected by this issue.
Workarounds
Users unable to patch should consider the following workarounds:
- Review your
PERMISSIONSclauses and remove any containingCREATE,UPDATE,DELETE,RELATE,INSERT, orUPSERT. - Limit who can define schema and vet imported data — such a clause must be defined before it can be triggered.
Resources
- DEFINE TABLE … PERMISSIONS
- DEFINE FIELD
fix(core): reject writes in PERMISSIONS clauses and block writes during permission evaluation(included in SurrealDB 3.2.0)
Acknowledgements
Thank you to sondt99 for reporting this issue.
Credited to sondt99.
References
- https://github.com/surrealdb/surrealdb/security/advisories/GHSA-66r2-5gwj-gxm2
- https://nvd.nist.gov/vuln/detail/CVE-2026-63733
- https://github.com/surrealdb/surrealdb/commit/1e4c3d743e1591f14f340cb627e56d98b6bd7fd7
- https://github.com/surrealdb/surrealdb/commit/afea699dfb3c8f274ab36861f8a95f5e98d82f1b
- https://github.com/surrealdb/surrealdb/releases/tag/v3.2.0
- https://www.vulncheck.com/advisories/surrealdb-before-permissions-bypass-via-permissions-clause
- https://github.com/advisories/GHSA-66r2-5gwj-gxm2
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesCVE-2024-58356
SurrealDB has Silent Failure to Overwrite Table Definition of Relation Type
low2.3Dec 16, 2024CVE-2024-58358
SurrealDB has an Uncaught Exception Handling Nonexistent Role
medium4.9Nov 22, 2024GHSA-h4f5-h82v-5w4r
SurrealDB has an Uncaught Exception in Function Generating Random Time
medium6.5Nov 22, 2024GHSA-m52v-24p8-654f
SurrealDB has an Uncaught Exception Sorting Tables by Random Order
medium6.5Nov 22, 2024CVE-2024-58367
SurrealDB: Improper Authorization in Select Permissions
high6.5Oct 8, 2024GHSA-qjrv-v6qp-x99x
SurrealDB has an Uncaught Exception Handling Parsing Errors on Empty Strings
high6.5Oct 8, 2024
