CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-63733

CVE-2026-63733: Incorrect Authorization in SurrealDB Permissions Clause

Alon Barad
Alon Barad
Software Engineer

Sep 5, 2026·7 min read·23 visits

Executive Summary (TL;DR)

A design flaw in SurrealDB allows authenticated users to bypass read-only database permission rules, enabling unauthorized writes and data modification through nested permission queries.

An incorrect authorization vulnerability (CWE-863) in SurrealDB allows authenticated, low-privileged users to execute unauthorized state-modifying queries. This occurs because the database disabled permissions during evaluation of custom PERMISSIONS WHERE predicates to prevent infinite recursion.

Vulnerability Overview

SurrealDB is a multi-model database engine designed for flexible schema definitions and fine-grained access control. Users utilize Role-Based Access Control (RBAC) and record-level permissions specified inside DEFINE TABLE and DEFINE FIELD declarations. These permission policies are computed dynamically during database operations using conditions specified in the PERMISSIONS clause.

The vulnerability tracked as CVE-2026-63733 is an incorrect authorization flaw (CWE-863) within the evaluation context of SurrealDB permission predicates. Because the engine disabled database permission enforcement while processing these predicates to prevent infinite recursive authorization loops, it opened an unanticipated write-privilege escalation vector. Any query execution occurring inside a table or field permission predicate inherited this unconstrained execution state.

An authenticated database user with minimal privileges can trigger the evaluation of a guarded resource's permissions. By arranging for the permission predicate to execute a data-modifying operation, such as an INSERT or CREATE query, the user bypasses standard database boundaries. This enables unauthorized writes to restricted tables or metadata structures without administrative privileges.

Root Cause Analysis

The root cause lies in how SurrealDB managed the query evaluation options context to prevent infinite recursion during permission verification. In SurrealDB, verifying table or field permissions often requires executing standard SurrealQL queries. For example, verifying a user's rights to a document might require reading metadata from a relation table, which itself requires permission checks, potentially leading to infinite recursion and stack overflow.

To prevent this loop, the engine's query scheduler disabled database permissions entirely while executing permission predicates. This was achieved by creating a cloned execution options struct where the permission check parameter was explicitly flagged as false. When this modified context became active, the query optimizer bypassed all authorization steps, assuming any action performed during permission evaluation was safe.

However, the query evaluation engine did not restrict the type of statement processed inside this permission context. The parser allowed arbitrary SurrealQL statement blocks, including data-modifying operations like CREATE, UPDATE, and DELETE. Consequently, when the scheduler executed a permission predicate containing write statements, the query ran to completion with administrative-level execution privileges.

Code Analysis

The patch resolves the privilege escalation vector through a multi-tier defense consisting of static AST inspection and dynamic runtime enforcement. At schema definition time, SurrealDB now traverses the AST of any permission predicate to check for write operations. If any write-like nodes are found during compilation, the database rejects the DEFINE or ALTER statement immediately.

The static checker utilizes the newly introduced has_direct_write function to recursively inspect query expressions:

// Post-patch AST static check implementation
pub(crate) fn has_direct_write(&self) -> bool {
    match self {
        // Data-modifying statements represent a direct write
        Expr::Create(_)
        | Expr::Update(_)
        | Expr::Delete(_)
        | Expr::Relate(_)
        | Expr::Insert(_)
        | Expr::Define(_)
        | Expr::Remove(_)
        | Expr::Rebuild(_)
        | Expr::Upsert(_)
        | Expr::Alter(_) => true,
 
        // Combinators are checked recursively
        Expr::Prefix { expr, .. }
        | Expr::Postfix { expr, .. }
        | Expr::Throw(expr) => expr.has_direct_write(),
        Expr::Binary { left, right, .. } => left.has_direct_write() || right.has_direct_write(),
        Expr::Return(s) => s.what.has_direct_write(),
        Expr::Let(s) => s.what.has_direct_write(),
        Expr::Block(block) => block.has_direct_write(),
        _ => false,
    }
}

This function identifies forbidden keywords and flags them before they can be written to the schema definition store.

Because users can define custom functions which perform side-effects and are only resolved at runtime, static analysis alone is insufficient. The second defense layer introduces a new runtime boolean permission_predicate inside the query context options. When executing permission evaluations, the system initializes options via new_for_permission_predicate() instead of disabling verification completely with new_with_perms(false).

// Runtime intercept during statement execution
if opt.permission_predicate
    && matches!(
        self,
        Expr::Create(_)
            | Expr::Update(_)
            | Expr::Upsert(_)
            | Expr::Delete(_)
            | Expr::Relate(_)
            | Expr::Insert(_)
            | Expr::Define(_)
            | Expr::Remove(_)
            | Expr::Rebuild(_)
            | Expr::Alter(_)
    ) {
    return Err(ControlFlow::Err(anyhow::Error::new(Error::PermissionPredicateSideEffect)));
}

This ensures that even if a write-enabling statement bypasses static analysis (such as through a pre-defined schema function execution), the runtime scheduler actively blocks the evaluation and returns a PermissionPredicateSideEffect error.

Exploitation Methodology

Exploitation of CVE-2026-63733 requires an attacker to have authenticated access to the target SurrealDB instance. The attacker must possess enough privileges to trigger a read or write operation on a table guarded by a custom permission predicate. If the schema contains a user-defined function executing mutations inside a permission clause, the attacker can execute arbitrary database writes.

A target scenario involves a database schema with an audit table and a victim table containing restricted data records. The database administrator declares a custom function fn::side_effect designed to write records to audit, but hooks it into the permission predicate for the victim table:

-- Schema setup
DEFINE TABLE audit SCHEMALESS PERMISSIONS FOR select FULL;
DEFINE FUNCTION fn::side_effect() {
    CREATE audit SET marker = true;
    RETURN true;
} PERMISSIONS FULL;
DEFINE TABLE victim SCHEMALESS PERMISSIONS FOR select, update WHERE fn::side_effect();

When an unprivileged user signs in with standard permissions and attempts to read from the victim table, SurrealDB evaluates the authorization conditions. This evaluation invokes fn::side_effect(). Under vulnerable versions, the nested CREATE audit query runs successfully inside the permission-free thread context, registering unauthorized records.

The following Mermaid sequence diagram illustrates the lifecycle of this authorization bypass and the execution flow leading to unauthorized data modification:

Security Impact Assessment

The impact of this vulnerability is unauthorized data modification and privilege escalation. While SurrealDB's role-based access control models are designed to isolate customer data and lock down schema definitions, CVE-2026-63733 invalidates these security guarantees. A low-privileged tenant or compromised database user can write data, alter schema definitions, or corrupt records.

The CVSS v3.1 base score is 4.3, with a vector string of CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N. This score is constrained because exploiting the vulnerability requires low privilege (PR:L) and results in low integrity impact (I:L) under standard vulnerability grading criteria. However, in multi-tenant environments relying entirely on SurrealDB row-level permissions for data isolation, this vulnerability represents a complete breakdown of isolation barriers.

The probability of exploitation remains low, as reflected by the EPSS score of 0.00287. It is not currently included on CISA's Known Exploited Vulnerabilities (KEV) catalog, nor are there functional public exploits available. Nevertheless, the integrity risks to environments running custom schemas with dynamic evaluation logic are significant.

Remediation & Mitigation Guide

The primary and recommended resolution is upgrading the database deployment to SurrealDB version 3.2.0 or later. This version contains the comprehensive double-layer fix that blocks data modification queries statically and dynamically during permission evaluation.

If immediate upgrading is not possible, system administrators must inspect all custom table and field definitions for potential side-effects. This can be achieved by dumping the database schema definition using SurrealQL commands and inspecting the output:

-- Export schema to review definitions
INFO FOR DB;

Identify any definitions that use user-defined functions or complex query blocks in their WHERE expressions. Replace dynamic, procedural permission logic with declarative, static filters. For example, ensure that policies are restricted to identity checks matching internal parameters (such as $auth.id == owner) rather than executing database queries.

Fix Analysis (2)

Technical Appendix

CVSS Score
4.3/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
EPSS Probability
0.29%
Top 79% most exploited

Affected Systems

SurrealDB

Affected Versions Detail

Product
Affected Versions
Fixed Version
SurrealDB
SurrealDB
< 3.2.03.2.0
AttributeDetail
CWE IDCWE-863
Attack VectorNetwork
CVSS v3.1 Score4.3
EPSS Score0.00287
ImpactIncorrect Authorization (Integrity Bypass)
Exploit StatusNone (No public exploit available)
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-863
Incorrect Authorization

The software performs an authorization check when an actor attempts to access a resource or perform an action, but the check is configured or implemented incorrectly, allowing unauthorized access.

References & Sources

  • [1]SurrealDB GitHub Security Advisory (GHSA-66r2-5gwj-gxm2)
  • [2]VulnCheck Security Advisory
  • [3]SurrealDB v3.2.0 Release Notes
  • [4]CVE-2026-63733 CVE Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-107844
5.3

CVE-2026-107844: Path Traversal Vulnerability in Contao ImagesController

A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.

Amit Schendel
Amit Schendel
8 views•5 min read
•1 day ago•CVE-2026-107848
3.5

CVE-2026-107848: Cross-Site Request Forgery (CSRF) in Contao Backend Actions via GET Requests

Contao Open Source CMS versions 4.0.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 contain a Cross-Site Request Forgery (CSRF) vulnerability in backend parameter handling. The `RequestTokenListener` component validates anti-CSRF tokens solely for HTTP POST requests, while GET-based declarative guards run only when an `act` parameter is present in the query string. Consequently, custom backend actions dispatched via alternative parameters such as `key=` can execute without CSRF token verification when triggered by an authenticated user.

Amit Schendel
Amit Schendel
7 views•5 min read
•1 day ago•CVE-2026-107843
5.3

CVE-2026-107843: Unthrottled Activation Email Resend and Account Enumeration in Contao CMS

Contao CMS versions 4.1.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 fail to validate form submission tokens and enforce rate limiting when processing activation email resend requests via HTTP POST, enabling resource exhaustion and account state enumeration.

Amit Schendel
Amit Schendel
8 views•4 min read
•1 day ago•CVE-2026-107842
5.3

CVE-2026-107842: Information Disclosure via Stale Indexing in Contao Search Module

An information disclosure vulnerability in Contao CMS allows unauthenticated site visitors to view protected page titles, URLs, and text excerpts through search queries when protected page indexing is disabled after previously being enabled.

Amit Schendel
Amit Schendel
10 views•4 min read
•1 day ago•GHSA-G38J-7V97-X298
6.5

GHSA-G38J-7V97-X298: Missing Authorization Check in Vikunja CalDAV Task Relation Creation

In Vikunja prior to version 2.6.0, relation creation via the CalDAV endpoint fails to invoke the TaskRelation.CanCreate authorization check. This missing access control allows an authenticated user to establish unauthorized relationships and perform write operations against any task, provided its unique identifier (UID) is known.

Alon Barad
Alon Barad
12 views•5 min read
•1 day ago•GHSA-3HC7-R24J-RPWC
6.8

GHSA-3hc7-r24j-rpwc: Cross-Project Task Disclosure via Subtask Expansion in Vikunja

A cross-project information disclosure vulnerability in Vikunja allows authenticated users with read access to one project to view private task details from unauthorized projects via subtask expansion parameters.

Alon Barad
Alon Barad
9 views•5 min read