GHSA-8rw6-p7m8-63jpMedium· 6.5▾ SunlitSurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users
▾ Sunlit zone — Low / medium · no exploitation signal
impact 35.8 · likelihood 0 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
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.
What an attacker can do:
field.*) SELECT permission should hide, on any table they can already SELECT.WHERE predicate — the wrong elements are selected either way.What it can't do:
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.
field.*) permissions to hide data from record users; use field-level permissions, which are enforced correctly.fix(sec): stop array element-level SELECT permissions leaking elements (commit 8f89b260b)surrealdb <= 3.1.3Upgrade to a patched release:
surrealdb 3.1.4Connected by shared product, vendor, weakness, or advisory.
CVE-2026-63740Medium· 6.5SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users
GHSA-fpxg-5xmv-922mMedium· 4.3SurrealDB has bypass of field-level SELECT permissions through JSON Patch `copy` and `move` with empty `from`
GHSA-6wqw-vhfr-9999Medium· 4.3SurrealDB: Authenticated subscribers can read records hidden by SELECT permissions via LIVE subscriptions
GHSA-wp87-mgvq-5j93Medium· 6.5SurrealDB: USE NS/DB implicit creation bypasses DEFINE authorization
GHSA-c8jx-96c9-8xrpMedium· 4.3SurrealDB: Field-level SELECT permissions bypassed via indexed COUNT fast paths
CVE-2026-49997Medium· 5.4SurrealDB: Edge PERMISSIONS FOR delete bypassed when a connected node is deleted