SurrealDB permissions bypass via PERMISSIONS clause

Severity: medium · CVSS 4.3 · Published 2026-07-20

SurrealDB is a multi-model database platform used for data storage and management. A permissions bypass flaw in versions before 3.2.0 allows authenticated users with limited access to write to tables they shouldn't have permission to access by embedding data-modifying statements in PERMISSIONS clauses. An attacker could corrupt data across multiple records in a single operation, bypassing table-level access controls.

Technologies: surrealdb (crates.io). Vendors: crates.io.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Medium severity, with a CVSS score of 4.3, published 20 July 2026.
Which products and versions are affected?
surrealdb (crates.io) < 3.2.0.
Is there a fix for This vulnerability?
A patch was published on 2026-07-20: Version 3.2.0 released Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network.
Am I affected?
Check whether you run surrealdb (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability exists in SurrealDB's permission evaluation mechanism (CWE-863: Incorrect Authorization). PERMISSIONS clauses are evaluated with enforcement disabled to prevent recursion into permission checks, but this also allows data-modifying SQL statements (CREATE, UPDATE, DELETE, RELATE, INSERT, UPSERT) embedded in the clause to execute without permission validation. An authenticated attacker with permission to trigger a guarded operation can exploit this by crafting a malicious permission clause that performs unauthorized writes to restricted tables. Since the clause evaluates once per matched record, a single statement can trigger multiple unauthorized writes. The fix (released in version 3.2.0) enforces read-only permission clauses by rejecting any writes in their definitions and blocking all write attempts during clause evaluation, including through called functions.

Affected products

  • SurrealDB SurrealDB < 3.2.0

Timeline

  • 2026-07-02: disclosed
  • 2026-07-20: patched: Version 3.2.0 released

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.