Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. surrealdb
  4. ›
  5. GHSA-h4h3-3rfj-x6fq

GHSA-h4h3-3rfj-x6fq: SurrealDB: Indexed ORDER BY leaks the value ordering of a SELECT-restricted field

June 19, 2026

A field can be hidden from a user with a field-level SELECT permission (DEFINE FIELD code ON secret PERMISSIONS FOR select WHERE owner = $auth.id). When that field is indexed, a record user who cannot read it could still recover the relative ordering of its values across every record by issuing ORDER BY <field>: the field came back null as intended, but the rows were returned in the hidden values’ true sorted order.

To satisfy the sort, the planner selects the field’s index and walks it in value order; the field-level permission is applied later, when the row is projected, so the value is nulled but the row order already encodes it. The guard that withholds restricted fields from the WHERE path was never applied to ORDER BY.

References

  • github.com/advisories/GHSA-h4h3-3rfj-x6fq
  • github.com/surrealdb/surrealdb/security/advisories/GHSA-h4h3-3rfj-x6fq

Code Behaviors & Features

Detect and mitigate GHSA-h4h3-3rfj-x6fq with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 3.0.0 before 3.1.5

Fixed versions

  • 3.1.5

Solution

Upgrade to version 3.1.5 or above.

Impact 4.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor

Source file

cargo/surrealdb/GHSA-h4h3-3rfj-x6fq.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:23:57 +0000.