surrealdb
Affected
- introduced
0, fixed3.1.4(semver)
Fixed versions
3.1.4
Fix
- Fixed version
3.1.4cargo update -p surrealdb --precise 3.1.4
Advisory
Also known as: 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. 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:
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:
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
field.*) permissions to hide data from record users; use field-level permissions, which are enforced correctly.Resources
fix(sec): stop array element-level SELECT permissions leaking elements (commit 8f89b260b)Medium Basis: The source's own band: MODERATE
0, fixed 3.1.4 (semver)3.1.4
3.1.4cargo update -p surrealdb --precise 3.1.4Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0