Skip to content

SurrealDB: Writes in a PERMISSIONS clause bypass table permissions

Moderate severity GitHub Reviewed Published Jul 2, 2026 in surrealdb/surrealdb • Updated Sep 4, 2026

Package

cargo surrealdb-core (Rust)

Affected versions

< 3.2.0

Patched versions

3.2.0

Description

A PERMISSIONS ... WHERE clause is evaluated with permission enforcement disabled, so it can't recurse into its own checks. But the clause could also contain data-modifying statements, and these ran with enforcement still off — so evaluating a permission check could write to tables the caller cannot write.

For example:

DEFINE TABLE post PERMISSIONS FOR update
    WHERE (CREATE log SET at = time::now()) OR true;

Any user allowed to update a post now also creates a log record, even with no permission on log. The clause is evaluated once per matched record, so one statement can cause several writes.

Impact

Only databases with a PERMISSIONS clause that contains a write are affected; FULL, NONE, and read-only clauses are not.

What an attacker can do:

  • With permission to perform the guarded operation (a low-privileged or record user is enough), write to tables in their own database that their permissions would otherwise forbid, by triggering an operation the clause guards.
  • Cause several writes from a single statement — the clause is evaluated once per matched record.
  • Trigger unintended events, cascades, or data corruption on those tables.

What it can't do:

  • Escape the caller's own namespace and database — a permission clause cannot switch namespace or database.
  • Perform root- or namespace-level actions such as creating users; the caller's role still applies.
  • Read hidden data — this is an integrity issue, not disclosure.

Patches

Permission clauses must now be read-only: defining or importing one that contains a write is rejected, and any write attempted while a clause is evaluated is blocked at runtime, including writes reached through a called function. Read-only clauses are unaffected.

  • Versions 3.2.0 and later are not affected by this issue.

Workarounds

Users unable to patch should consider the following workarounds:

  • Review your PERMISSIONS clauses and remove any containing CREATE, UPDATE, DELETE, RELATE, INSERT, or UPSERT.
  • Limit who can define schema and vet imported data — such a clause must be defined before it can be triggered.

Resources

Acknowledgements

Thank you to sondt99 for reporting this issue.

References

@rushmorem rushmorem published to surrealdb/surrealdb Jul 2, 2026
Published to the GitHub Advisory Database Sep 4, 2026
Reviewed Sep 4, 2026
Last updated Sep 4, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(21st percentile)

Weaknesses

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. Learn more on MITRE.

CVE ID

CVE-2026-63733

GHSA ID

GHSA-66r2-5gwj-gxm2

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.