CVE-2026-63740: SurrealDB Array Element-level (field.*) SELECT Permissions Vulnerability

MODERATE
Advisory Identifier: GHSA-8rw6-p7m8-63jp
CVSS 6.5
CWE-863
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-63740
GHSA Identifier GHSA-8rw6-p7m8-63jp
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-863: Incorrect Authorization
Affected Product SurrealDB
Package Ecosystem crates.io
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

surrealdb fixed: 3.1.4
Upgrade surrealdb to 3.1.4
Verify Direct and Transitive Dependencies

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

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 `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). ## 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](https://surrealdb.com/docs/surrealql/statements/define/field) - [USERS](https://surrealdb.com/docs/learn/security/authentication/authentication) - [DEFINE TABLE … PERMISSIONS](https://surrealdb.com/docs/surrealql/statements/define/table) - `fix(sec): stop array element-level SELECT permissions leaking elements` (commit `8f89b260b`)

CVE-2026-63740 Affected SurrealDB Versions

1 component(s)
Fixed Versions:
3.1.4
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?
CVE-2026-63740 is a security vulnerability in SurrealDB involving Array element-level (field.*) SELECT permissions leak denied elements to record users under CWE-863: Incorrect Authorization.
Which SurrealDB versions are affected?
Affected versions include releases prior to 3.1.4 across affected packages: surrealdb.
What version fixes CVE-2026-63740?
Upgrading to 3.1.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is surrealdb affected?
Yes, surrealdb is affected in releases prior to 3.1.4. Upgrade your dependency to 3.1.4 or later.
What is the CVSS score of CVE-2026-63740?
CVE-2026-63740 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-63740?
CVE-2026-63740 is classified under CWE-863: Incorrect Authorization (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.).
How can I check crates.io dependencies for CVE-2026-63740?
Run the dependency tree command: 'inspect dependencies for surrealdb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}