Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🦀
🦀 crates.io
Not in CISA KEV
MEDIUM severity

GHSA-8rw6-p7m8-63jp

MEDIUMFix: surrealdb/surrealdb@8f89b26

GHSA-8rw6-p7m8-63jp is a medium-severity (CVSS 6.5) vulnerability in surrealdb. O3 Security confirms whether GHSA-8rw6-p7m8-63jp is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

SurrealDB: Array element-level (field.*) SELECT permissions leak denied elements to record users

Published
Aug 14, 2026
Updated
Aug 14, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Aug 14, 2026 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected
🦀surrealdb

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.

Description

A SELECT permission defined on an array element (DEFINE FIELD field.* … PERMISSIONS FOR select …) is not enforced correctly for RECORD users. Instead of hiding the denied elements, the query leaks a subset of them: a deny-all returns the odd-indexed elements, and a per-element predicate keeps and drops the wrong ones.

The filter removed each denied element by index while walking the array forwards. Because removing an element shifts every later index down, each cut invalidated the indices still pending in the loop, leaving denied elements behind. Field-level permissions are enforced correctly; only the element (field.*) level is affected, and only for record users — root and record-owner sessions are not.

Impact

What an attacker can do:

  • As a record (scope) user, read array elements that an element-level (field.*) SELECT permission should hide, on any table they can already SELECT.
  • Recover denied elements through both a deny-all and a WHERE predicate — the wrong elements are selected either way.

What it can't do:

  • Bypass field-level SELECT permissions, which are evaluated correctly.
  • Affect root or record-owner sessions, or cross namespace/database isolation.
  • Modify data, escalate privileges, or affect availability (confidentiality only).

Patches

The three permission-filtering paths (doc/reduce.rs, doc/output.rs, exec/operators/scan/pipeline.rs) now remove denied elements in reverse index order, so removing one element no longer shifts the elements still to be checked. Regression tests reproducing the issue were added.

The fix is included in SurrealDB 3.1.4.

Workarounds

  • Do not rely on element-level (field.*) permissions to hide data from record users; use field-level permissions, which are enforced correctly.
  • Restrict record users from selecting tables whose schema uses element-level permissions.

Resources

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🦀crates.iosurrealdball versions3.1.4

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for surrealdb. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update surrealdb to 3.1.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-8rw6-p7m8-63jp is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-8rw6-p7m8-63jp is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-8rw6-p7m8-63jp. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

A `SELECT` permission defined on an array element (`DEFINE FIELD field.* … PERMISSIONS FOR select …`) is not enforced correctly for `RECORD` users. Instead of hiding the denied elements, the query leaks a subset of them: a deny-all returns the odd-indexed elements, and a per-element predicate keeps and drops the wrong ones. The filter removed each denied element by index while walking the array forwards. Because removing an element shifts every later index down, each cut invalidated the indices still pending in the loop, leaving denied elements behind. Field-level permissions are enforced cor
O3 Security · Impact-Aware SCA

Is GHSA-8rw6-p7m8-63jp in your dependencies?

O3 detects GHSA-8rw6-p7m8-63jp across crates.io dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-8rw6-p7m8-63jp: surrealdb (Medium 6.5) | O3 Security