Skip to content
surrealdbGHSA-8rw6-p7m8-63jp

SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users

Medium6.5CVE-2026-63740 · Published Aug 14, 2026 · updated Sep 4, 2026

GitHub advisory

Affected versions

PackageAffectedFixed in
surrealdb
crates.io
< 3.1.43.1.4
Details and references

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 `WHERE` predicate , 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](https://surrealdb.com/docs/surrealql/statements/define/field) - [USERS](https://surrealdb.com/docs/learn/security/authentication/authentication) - [DEFINE TABLE … PERMISSIONS](https://surrealdb.com/docs/surrealql/statements/define/table) - `fix(sec): stop array element-level SELECT permissions leaking elements` (commit `8f89b260b`)

CVSS 3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Severity from
GitHub (reviewed advisory)
Weakness
CWE-863
Also known as
CVE-2026-63740

More surrealdb advisories

All
DateAdvisory
Sep 4SurrealDB: Custom API route lets authenticated callers override namespace/database scope via URL path
CVE-2026-63735High8.1fixed in 3.2.0
Jul 1SurrealDB: Edge PERMISSIONS FOR delete bypassed when a connected node is deleted
CVE-2026-49997Medium5.4fixed in 3.1.0
Jul 1SurrealDB: ES512 silently downgraded to ES384 due to jsonwebtoken crate limitation
CVE-2026-63761Medium4.3fixed in 3.1.0
Jul 1SurrealDB: Field-level SELECT permissions bypassed via indexed COUNT fast paths
GHSA-c8jx-96c9-8xrpMedium4.3fixed in 3.1.0
Jul 1SurrealDB: USE NS/DB implicit creation bypasses DEFINE authorization
GHSA-wp87-mgvq-5j93Medium6.5fixed in 3.1.0
Jul 1SurrealDB: Port-specific --deny-net rules silently bypassed on HTTP redirect
CVE-2026-63743Medium6.4fixed in 3.1.0

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.