Skip to main content

CVE-2026-63740 — Vulnerability in surrealdb — CVE Details

MEDIUM

SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users

Published August 14, 2026Updated September 4, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.36%). Schedule for your next planned update.

Does your project use an affected surrealdb version?

Paste your Cargo.lock to check it for CVE-2026-63740 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Cargo.lock

Summary

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

Advisory Timeline

  • First published August 14, 2026 (104 days ago).
  • Last revised September 4, 2026 — 21 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update surrealdb to 3.1.4 or later
cargo update -p surrealdb --precise 3.1.4

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: crates.io (1).

PackageFixed In
surrealdb crates.io · Affected: All versions3.1.4

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-863
    Incorrect AuthorizationMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Frequently Asked Questions

What is CVE-2026-63740?
SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.5/10).
How do I check if my project is affected by CVE-2026-63740?
CVE-2026-63740 affects surrealdb. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-63740 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.5

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.36%
EPSS percentile: 21.9

This is a below-median EPSS score — only 21.9% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-8rw6-p7m8-63jp

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock