# CVE-2026-63740: SurrealDB incorrect authorization in array element SELECT permissions

Source: https://junglewise.ai/threats/cve-2026-63740-surrealdb-incorrect-authorization-in-array-element-select  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-20. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-63740 · Severity: medium · CVSS 6.5 · Published 2026-07-20

SurrealDB is a NoSQL database that uses permission rules to control which data users can read. The vulnerability allows users with limited "record" access to read array elements that should be hidden by field-level permission rules. An attacker can systematically recover denied data by exploiting an off-by-one indexing bug in the permission filter. This only affects confidentiality and requires the attacker to already have basic read access to the affected table.

Technologies: [surrealdb (crates.io)](https://junglewise.ai/threats/technologies/surrealdb). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is CVE-2026-63740 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-63740 being exploited in the wild.

**How severe is CVE-2026-63740?** Medium severity, with a CVSS score of 6.5, published 20 July 2026.

**Which products and versions are affected?** surrealdb (crates.io) <= 3.1.3, SEMVER:introduced=0,fixed=3.1.4.

**Is there a fix for CVE-2026-63740?** Yes. surrealdb (crates.io): upgrade to 3.1.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-63740 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-63740?** 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.

## How to fix

- surrealdb (crates.io): upgrade to 3.1.4 or later

  ```sh
  cargo update -p surrealdb
  ```


## Technical details

The vulnerability is an incorrect authorization flaw (CWE-863) in SurrealDB's permission filter logic. When a `SELECT` permission is defined on array elements using `DEFINE FIELD field.* PERMISSIONS FOR select`, the filter in three code paths (doc/reduce.rs, doc/output.rs, exec/operators/scan/pipeline.rs) removes denied elements by index while iterating forward through the array. Because array removal shifts all subsequent indices down by one, the loop's remaining index references become invalid, leaving some denied elements in the result. The attack requires the attacker to already have SELECT access to the table and a valid record session; root and owner sessions are not affected. The fix (commit 8f89b260b) processes removals in reverse index order to prevent index invalidation. Field-level permissions remain correctly enforced.

## Affected products

- SurrealDB SurrealDB <= 3.1.3

## Identifiers

- CVE-2026-63740
- GHSA-8rw6-p7m8-63jp

## Timeline

- 2026-06-10: disclosed: Published to GitHub Advisory Database
- 2026-08-14: patched: Fix included in SurrealDB 3.1.4

## References

- [https://api.github.com/users/msanchezdev](https://api.github.com/users/msanchezdev)
- [https://github.com/msanchezdev](https://github.com/msanchezdev)
- [https://api.github.com/users/msanchezdev/gists%7B/gist_id%7D](https://api.github.com/users/msanchezdev/gists%7B/gist_id%7D)
- [https://api.github.com/users/msanchezdev/repos](https://api.github.com/users/msanchezdev/repos)
- [https://avatars.githubusercontent.com/u/35346082?v=4](https://avatars.githubusercontent.com/u/35346082?v=4)
- [https://api.github.com/users/msanchezdev/events%7B/privacy%7D](https://api.github.com/users/msanchezdev/events%7B/privacy%7D)

## 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)
