CVE-2026-63740 is a medium-severity (CVSS 6.5) CWE-863 vulnerability in surrealdb. A fix is available for surrealdb — see the affected versions and patch details below.
SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-63740.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2026-63740 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 383,485 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
surrealdbReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
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)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | surrealdb | all versions | 3.1.4cargo update -p surrealdb --precise 3.1.4 |
Affected Products
surrealdbsurrealdbDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for surrealdb, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update surrealdb to 3.1.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-63740 is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Frequently Asked Questions
Is CVE-2026-63740 in your dependencies?
Find it across crates.io, including transitive dependencies.