Loading advisory.
Loading advisory.
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.
Published 2026-07-20 12:04 UTC · Modified 2026-09-04 20:10 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| surrealdb | crates.io | < 3.1.4 | 3.1.4 | cargo add surrealdb@3.1.4 |
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:
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).
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.
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.
fix(sec): stop array element-level SELECT permissions leaking elements (commit 8f89b260b)
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
One EPSS score on record: 0.004 on 2026-11-24.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.004 | first score | v2026.06.15 |