CVE-2023-54366: SurrealDB Full Table Permissions By Default Vulnerability

HIGH
Advisory Identifier: GHSA-x5fr-7hhj-34j3
CVSS 8.8
CWE-276
Published
Advisory Summary

CVE-2023-54366 is a HIGH (CVSS 8.8) full table permissions by default vulnerability (CWE-276: Incorrect Default Permissions) affecting SurrealDB libraries in the crates.io ecosystem. The issue involves full table permissions by default. Remediation is available by upgrading affected packages to version 1.0.1.

CVE-2023-54366 at a Glance

CVE Identifier CVE-2023-54366
GHSA Identifier GHSA-x5fr-7hhj-34j3
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-276: Incorrect Default Permissions
Affected Product SurrealDB
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-54366

To remediate this vulnerability, upgrade all affected SurrealDB dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

surrealdb fixed: 1.0.1
Upgrade surrealdb to 1.0.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for surrealdb

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-54366, inspect your project dependencies for SurrealDB:

inspect dependencies for surrealdb

Analyze the terminal output to locate any version of SurrealDB in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In SurrealDB, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Default table permissions in SurrealDB were `FULL` instead of `NONE`. This would lead to tables having `FULL` permissions for `SELECT`, `CREATE`, `UPDATE` and `DELETE` unless some other permissions were specified via the `PERMISSIONS` clause. We have decided to treat this behaviour as a vulnerability due to its security implications, especially considering the lack of specific documentation and potential for confusion due to the `INFO FOR DB` statement previously not displaying default permissions. Treating it as a bug fix provides justification for a change in default behavior outside of a major release. ### Impact Any client authorized to query data in a SurrealDB instance will have full access to any tables that were defined with no explicit permissions and that are within its authorization scope (i.e. namespace or database), including creating, reading, updating and deleting data. This is specially relevant for SurrealDB instances allowing guest access with publicly exposed interfaces (e.g. HTTP REST API or WebSocket API), since a remote unauthenticated user may gain full access to any tables that were defined without any explicit permissions. Tables that were defined with explicit permissions using the `PERMISSIONS` clause are not affected. ### Patches - Version `1.0.1` includes a patch for this specific issue. Later releases will also include the patch. - Version `1.1.0-beta.1` and latest nightly releases already include the patch for this issue. In patched versions: - Tables defined after the patch without explicit permissions have `NONE` permissions. - Table permissions are always explicitly displayed with the `INFO FOR DB` statement. ### Workarounds In unpatched versions, this issue can be resolved by explicitly defining table permissions as shown in the following examples: ```sql -- INSECURE EXAMPLE -- DEFINE TABLE insecure; -- SECURE EXAMPLE 1 DEFINE TABLE secure PERMISSIONS NONE; -- SECURE EXAMPLE 2 DEFINE TABLE secure PERMISSIONS FOR SELECT, CREATE, UPDATE, DELETE NONE; -- SECURE EXAMPLE 3 DEFINE TABLE secure PERMISSIONS FOR SELECT WHERE user = $auth.id, CREATE, UPDATE, DELETE NONE; -- SECURE EXAMPLE 4 DEFINE TABLE secure PERMISSIONS FOR select WHERE published = true OR user = $auth.id FOR create, update WHERE user = $auth.id FOR delete WHERE user = $auth.id OR $auth.admin = true; ``` ### References - https://github.com/surrealdb/surrealdb/pull/3074 - https://github.com/surrealdb/surrealdb/pull/3083 - https://github.com/surrealdb/surrealdb/pull/3125 - https://docs.surrealdb.com/docs/surrealql/statements/define/table/ - https://docs.surrealdb.com/docs/security/capabilities#guest-access

CVE-2023-54366 Affected SurrealDB Versions

1 component(s)
Fixed Versions:
1.0.1
Product / Package Ecosystem Affected Versions Fixed Version
surrealdb
crates.io
< 1.0.1
1.0.1

References

Frequently Asked Questions

What is CVE-2023-54366?
CVE-2023-54366 is a security vulnerability in SurrealDB involving Full Table Permissions by Default under CWE-276: Incorrect Default Permissions.
Which SurrealDB versions are affected?
Affected versions include releases prior to 1.0.1 across affected packages: surrealdb.
What version fixes CVE-2023-54366?
Upgrading to 1.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is surrealdb affected?
Yes, surrealdb is affected in releases prior to 1.0.1. Upgrade your dependency to 1.0.1 or later.
What is the CVSS score of CVE-2023-54366?
CVE-2023-54366 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-54366?
CVE-2023-54366 is classified under CWE-276: Incorrect Default Permissions (During installation, installed file permissions are set to allow anyone to modify those files.).
How can I check crates.io dependencies for CVE-2023-54366?
Run the dependency tree command: 'inspect dependencies for surrealdb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-x5fr-7hhj-34j3",
  "modified" : "2026-09-04T18:27:59Z",
  "published" : "2023-12-15T03:46:36Z",
  "aliases" : [ "CVE-2023-54366" ],
  "summary" : "SurrealDB: Full Table Permissions by Default",
  "details" : "Default table permissions in SurrealDB were `FULL` instead of `NONE`. This would lead to tables having `FULL` permissions for `SELECT`, `CREATE`, `UPDATE` and `DELETE` unless some other permissions were specified via the `PERMISSIONS` clause.\n\nWe have decided to treat this behaviour as a vulnerability due to its security implications, especially considering the lack of specific documentation and potential for confusion due to the `INFO FOR DB` statement previously not displaying default permissions. Treating it as a bug fix provides justification for a change in default behavior outside of a major release.\n\n### Impact\n\nAny client authorized to query data in a SurrealDB instance will have full access to any tables that were defined with no explicit permissions and that are within its authorization scope (i.e. namespace or database), including creating, reading, updating and deleting data. This is specially relevant for SurrealDB instances allowing guest access with publicly exposed interfaces (e.g. HTTP REST API or WebSocket API), since a remote unauthenticated user may gain full access to any tables that were defined without any explicit permissions. Tables that were defined with explicit permissions using the `PERMISSIONS` clause are not affected.\n\n### Patches\n\n- Version `1.0.1` includes a patch for this specific issue. Later releases will also include the patch.\n- Version `1.1.0-beta.1` and latest nightly releases already include the patch for this issue.\n\nIn patched versions:\n\n- Tables defined after the patch without explicit permissions have `NONE` permissions.\n- Table permissions are always explicitly displayed with the `INFO FOR DB` statement.\n\n### Workarounds\n\nIn unpatched versions, this issue can be resolved by explicitly defining table permissions as shown in the following examples:\n\n```sql\n-- INSECURE EXAMPLE\n-- DEFINE TABLE insecure;\n-- SECURE EXAMPLE 1\nDEFINE TABLE secure PERMISSIONS NONE;\n-- SECURE EXAMPLE 2\nDEFINE TABLE secure PERMISSIONS FOR SELECT, CREATE, UPDATE, DELETE NONE;\n-- SECURE EXAMPLE 3\nDEFINE TABLE secure PERMISSIONS FOR\n  SELECT WHERE user = $auth.id,\n  CREATE, UPDATE, DELETE NONE;\n-- SECURE EXAMPLE 4\nDEFINE TABLE secure PERMISSIONS\n  FOR select WHERE published = true OR user = $auth.id\n  FOR create, update WHERE user = $auth.id\n  FOR delete WHERE user = $auth.id OR $auth.admin = true;\n```\n\n### References\n\n- https://github.com/surrealdb/surrealdb/pull/3074\n- https://github.com/surrealdb/surrealdb/pull/3083\n- https://github.com/surrealdb/surrealdb/pull/3125\n- https://docs.surrealdb.com/docs/surrealql/statements/define/table/\n- https://docs.surrealdb.com/docs/security/capabilities#guest-access",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "surrealdb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-x5fr-7hhj-34j3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-54366"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/surrealdb/PYSEC-2026-3718.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/surrealdb/surrealdb"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/surrealdb-before-insecure-default-table-permissions"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-276" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-15T03:46:36Z",
    "nvd_published_at" : null
  }
}