Skip to content
surrealdbGHSA-wp87-mgvq-5j93

SurrealDB: USE NS/DB implicit creation bypasses DEFINE authorization

Medium6.5Published Jul 1, 2026

GitHub advisory

Affected versions

PackageAffectedFixed in
surrealdb
crates.io
< 3.1.03.1.0
Details and references

An anonymous caller could create new namespaces and databases on a running SurrealDB instance without holding `DEFINE NAMESPACE` or `DEFINE DATABASE` permission. `USE NS <name>` and `USE DB <name>` automatically create the target when it does not exist. The three places `USE` is handled , the RPC `use` method, `Datastore::process_use`, and the SurrealQL executor , did not check whether the caller was allowed to create the resource. Under default capabilities any session reached this path, including an unauthenticated guest. ### Impact What an attacker **can** do: - Create new namespaces and databases without `DEFINE NAMESPACE` / `DEFINE DATABASE` permission. An unauthenticated guest is enough under default capabilities. - Recreate a parent namespace that an operator deliberately dropped, using a stale namespace-Editor token, by running `USE NS <dropped> DB anything`. - Exhaust catalog storage by repeatedly creating new resources. What it **can't** do: - Read or modify data inside any pre-existing namespace or database. - Escalate to root or namespace-owner privileges on existing resources. - Affect deployments running with `auth_enabled=false`. ### Patches All three `USE` entry points now check whether the caller has `DEFINE NAMESPACE` / `DEFINE DATABASE` authority before creating a missing target. Sessions still update their context regardless of authorization, so SDKs that send `use` before `signin` continue to work , only the catalog creation step is gated. The parent-namespace side-effect path is closed by the same check. Versions 3.1.0 and later are not affected. ### Workarounds - Set `--deny-arbitrary-query *` for guest principals to remove the entry point. - Run with `--auth` and require all callers to `signin` before issuing `use`. - Revoke namespace-level tokens promptly when a namespace is dropped.

CVSS 3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
Severity from
GitHub (reviewed advisory)
Weakness
CWE-862, CWE-863

More surrealdb advisories

All
DateAdvisory
Jul 1SurrealDB: HTTP /rpc `sessions` method leaks attached session UUIDs, enabling full session hijack by anonymous callers
GHSA-5qfp-32cf-69jhHigh8.8fixed in 3.1.0
Jul 1SurrealDB: HTTP RPC Session Race Condition Allows Privilege Escalation
GHSA-4vgr-h27g-cf9pHigh8.1fixed in 3.1.0
Jul 1SurrealDB has Denial of Service in JSON parser due to nested objects
CVE-2026-63760High7.5fixed in 3.1.0
Jul 1SurrealDB has unauthenticated remote DoS via malformed RPC `use` call
GHSA-wjjj-24cx-f28gHigh7.5fixed in 3.1.0
Jul 1SurrealDB vulnerable to Denial of Service due to nested types annotations
GHSA-q8qp-67f9-wr3fMedium6.5fixed in 3.1.0
Jul 1SurrealDB: Scraping a TABLE with no available PERMISSIONS to current auth level
CVE-2026-63755Medium6.5fixed in 3.1.0

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.