CVE-2026-63740: SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users
A SELECT permission defined on an array element (DEFINE FIELD field. … PERMISSIONS FOR select …) is not enforced correctly for RECORD users. Instead of hiding the denied elements, the query leaks a subset of them: a deny-all returns the odd-indexed elements, and a per-element predicate keeps and drops the wrong ones. The filter removed each denied element by index while walking the array forwards.
Published Aug 14, 2026 · Updated Sep 4, 2026
Affected packages
surrealdb
- Ecosystem
- Rust (crates.io)
- Affected
- <= 3.1.3
- Fixed in
- 3.1.4
- Check
cargo tree -i surrealdb
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
A SELECT permission defined on an array element (DEFINE FIELD field.* … PERMISSIONS FOR select …) is not enforced correctly for RECORD users. Instead of hiding the denied elements, the query leaks a subset of them: a deny-all returns the odd-indexed elements, and a per-element predicate keeps and drops the wrong ones.
The filter removed each denied element by index while walking the array forwards. Because removing an element shifts every later index down, each cut invalidated the indices still pending in the loop, leaving denied elements behind. Field-level permissions are enforced correctly; only the element (field.*) level is affected, and only for record users — root and record-owner sessions are not.
Impact
What an attacker can do:
- As a record (scope) user, read array elements that an element-level (
field.*) SELECT permission should hide, on any table they can already SELECT. - Recover denied elements through both a deny-all and a
WHEREpredicate — the wrong elements are selected either way.
What it can't do:
- Bypass field-level SELECT permissions, which are evaluated correctly.
- Affect root or record-owner sessions, or cross namespace/database isolation.
- Modify data, escalate privileges, or affect availability (confidentiality only).
Patches
The three permission-filtering paths (doc/reduce.rs, doc/output.rs, exec/operators/scan/pipeline.rs) now remove denied elements in reverse index order, so removing one element no longer shifts the elements still to be checked. Regression tests reproducing the issue were added.
The fix is included in SurrealDB 3.1.4.
Workarounds
- Do not rely on element-level (
field.*) permissions to hide data from record users; use field-level permissions, which are enforced correctly. - Restrict record users from selecting tables whose schema uses element-level permissions.
Resources
- DEFINE FIELD
- USERS
- DEFINE TABLE … PERMISSIONS
fix(sec): stop array element-level SELECT permissions leaking elements(commit8f89b260b)
Credited to msanchezdev.
References
- https://github.com/surrealdb/surrealdb/security/advisories/GHSA-8rw6-p7m8-63jp
- https://github.com/surrealdb/surrealdb/commit/8f89b260bb9692e5b0d58930793d482a8207eedc
- https://nvd.nist.gov/vuln/detail/CVE-2026-63740
- https://www.vulncheck.com/advisories/surrealdb-before-array-element-permission-bypass
- https://github.com/advisories/GHSA-8rw6-p7m8-63jp
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-2026-63735
SurrealDB: Custom API route lets authenticated callers override namespace/database scope via URL path
high8.1Sep 4, 2026CVE-2026-49997
SurrealDB: Edge PERMISSIONS FOR delete bypassed when a connected node is deleted
medium5.4Jul 1, 2026CVE-2026-63743
SurrealDB: Port-specific --deny-net rules silently bypassed on HTTP redirect
medium6.4Jul 1, 2026CVE-2026-63746
SurrealDB: Graph traversal bypasses table SELECT permissions
medium6.5Jul 1, 2026CVE-2026-63748
SurrealDB: Authenticated callers can read fields hidden by field-level SELECT permissions via error messages
medium4.3Jul 1, 2026CVE-2026-63751
SurrealDB has bypass of field-level SELECT permissions through JSON Patch `copy` and `move` with empty `from`
medium4.3Jul 1, 2026
