CVE-2026-63740: SurrealDB Array Element-level (field.*) SELECT Permissions Vulnerability
MODERATECVE-2026-63740 is a MODERATE (CVSS 6.5) array element-level (field.*) select permissions vulnerability (CWE-863: Incorrect Authorization) affecting SurrealDB libraries in the crates.io ecosystem. The issue involves array element-level (field.*) select permissions leak denied elements to record users. Remediation is available by upgrading affected packages to version 3.1.4.
CVE-2026-63740 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2026-63740
To remediate this vulnerability, upgrade all affected SurrealDB dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade surrealdb to 3.1.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for surrealdb
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-63740, inspect your project dependencies for SurrealDB:
inspect dependencies for surrealdb
Analyze the terminal output to locate any version of SurrealDB in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In SurrealDB, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-63740 Affected SurrealDB Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
surrealdb
|
crates.io |
< 3.1.4
|
3.1.4
|
References
Frequently Asked Questions
What is CVE-2026-63740?
Which SurrealDB versions are affected?
What version fixes CVE-2026-63740?
Is surrealdb affected?
What is the CVSS score of CVE-2026-63740?
What CWE is associated with CVE-2026-63740?
How can I check crates.io dependencies for CVE-2026-63740?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8rw6-p7m8-63jp",
"modified" : "2026-09-04T19:48:51Z",
"published" : "2026-08-14T19:40:48Z",
"aliases" : [ "CVE-2026-63740" ],
"summary" : "SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users",
"details" : "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.\n\nThe 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.\n\n## Impact\n\nWhat an attacker **can** do:\n\n- As a record (scope) user, read array elements that an element-level (`field.*`) SELECT permission should hide, on any table they can already SELECT.\n- Recover denied elements through both a deny-all and a `WHERE` predicate — the wrong elements are selected either way.\n\nWhat it **can't** do:\n\n- Bypass field-level SELECT permissions, which are evaluated correctly.\n- Affect root or record-owner sessions, or cross namespace/database isolation.\n- Modify data, escalate privileges, or affect availability (confidentiality only).\n\n## Patches\n\nThe 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.\n\nThe fix is included in SurrealDB 3.1.4.\n\n## Workarounds\n\n- Do not rely on element-level (`field.*`) permissions to hide data from record users; use field-level permissions, which are enforced correctly.\n- Restrict record users from selecting tables whose schema uses element-level permissions.\n\n## Resources\n\n- [DEFINE FIELD](https://surrealdb.com/docs/surrealql/statements/define/field)\n- [USERS](https://surrealdb.com/docs/learn/security/authentication/authentication)\n- [DEFINE TABLE … PERMISSIONS](https://surrealdb.com/docs/surrealql/statements/define/table)\n- `fix(sec): stop array element-level SELECT permissions leaking elements` (commit `8f89b260b`)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.1.3"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-8rw6-p7m8-63jp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-63740"
}, {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/commit/8f89b260bb9692e5b0d58930793d482a8207eedc"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/surrealdb/surrealdb"
}, {
"type" : "WEB",
"url" : "https://www.vulncheck.com/advisories/surrealdb-before-array-element-permission-bypass"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-863" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-14T19:40:48Z",
"nvd_published_at" : null
}
}