# SurrealDB improper authorization in field permissions

Source: https://junglewise.ai/threats/surrealdb-improper-authorization-in-field-permissions-50d5e9e6  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-18. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: medium · CVSS 6.5 · Published 2026-07-18

SurrealDB is a multi-model database platform used as a backend for applications requiring fine-grained access control. A flaw in versions before 2.0.4 allows authenticated users with limited permissions to read sensitive field values they should not have access to, through various query manipulation techniques. This could enable data leakage and unauthorized information disclosure in applications relying on field-level permissions for data protection.

Technologies: [surrealdb (crates.io)](https://junglewise.ai/threats/technologies/surrealdb). Vendors: [crates.io](https://junglewise.ai/threats/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 6.5, published 18 July 2026.

**Which products and versions are affected?** surrealdb (crates.io) < 2.0.4.

**Is there a fix for This vulnerability?** A patch was published on 2024-10-08: Fixed in version 2.0.4 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, in a software library.

**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 stems from improper authorization enforcement in SurrealDB's query processing pipeline, specifically CWE-285 (Improper Authorization). The root cause is that field permissions were validated after query operations rather than before, allowing multiple bypass techniques: SELECT VALUE queries skip permission checks on non-iterable return values; field aliasing bypasses permissions by checking against the aliased field name instead of the original; functions receive field values before permission filtering; WHERE clauses leak information via side-channels; UPDATE/DELETE operations expose record contents via RETURN BEFORE; and UPDATE SET clauses can reference unpermitted fields. The attack requires network access and low privileges (authenticated database user), with no user interaction needed. An attacker can extract protected field contents despite lacking SELECT permissions on those fields. Patched in version 2.0.4, which reorders permission evaluation to occur before document modifications.

## Affected products

- SurrealDB SurrealDB < 2.0.4
- SurrealDB surrealdb-core < 2.0.4

## Timeline

- 2024-10-08: disclosed: Original advisory GHSA-9722-9j67-vjcr published
- 2024-10-08: patched: Fixed in version 2.0.4
- 2026-07-18: advisory: Duplicate advisory GHSA-j9rh-f527-3x87 published
- 2026-09-04: other: Duplicate advisory withdrawn as duplicate of GHSA-9722-9j67-vjcr

## References

- [https://github.com/surrealdb/surrealdb/security/advisories/GHSA-9722-9j67-vjcr](https://github.com/surrealdb/surrealdb/security/advisories/GHSA-9722-9j67-vjcr)
- [https://www.vulncheck.com/advisories/surrealdb-before-improper-authorization-via-select-permissions](https://www.vulncheck.com/advisories/surrealdb-before-improper-authorization-via-select-permissions)

## Related threats

- [SurrealDB use-after-free in KV backends via affinitypool spawn_local](https://junglewise.ai/threats/cve-2026-121417-surrealdb-before-3-3-0-contains-a-use-after-free-vulnerability)
- [SurrealDB JSON parser denial of service via uncontrolled recursion](https://junglewise.ai/threats/surrealdb-json-parser-denial-of-service-via-uncontrolled-recursion-3037f8a0)
- [SurrealDB ES512 algorithm silently downgraded to ES384](https://junglewise.ai/threats/surrealdb-es512-algorithm-silently-downgraded-to-es384-f0af29b8)
- [SurrealDB permission bypass via WHERE clause evaluation](https://junglewise.ai/threats/surrealdb-permission-bypass-via-where-clause-evaluation-afa6f001)
- [SurrealDB authorization bypass in KILL statement](https://junglewise.ai/threats/surrealdb-authorization-bypass-in-kill-statement-fc230d0f)
