🛡️ CVE-2024-58363 — surrealdb

🟡 CVSS 6.3 — Medium ✅ No Known Exploit CWE-287 NVD
6.3
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

SurrealDB vulnerable to Improper Authentication when Changing Databases as Scope User

Authentication would not be properly validated when an already authenticated scope user would use the use method or USE clause to switch working databases in a session. If there was a user record in the new database with identical record identifier as the original record that the user authenticated with in the original database, this could result in the user being able to perform actions under the identity of the unrelated user in the new database. This issue does not affect system users at any level.

By default, record identifiers are randomly generated with sufficient complexity to prevent the identifier collision required to trigger this issue. However, the issue may trigger in situations where multiple databases in the same SurrealDB instance are using explicitly defined or incremental record identifiers to identify users on an identically named table.

Impact

Under the circumstances described above, a user who has an authenticated session as a scope user in a database could become authorized to query data under the identity of a specific scope user associated with an identical record identifier in a different database within the same SurrealDB instace if the PERMISSIONS clause would allow it due to relying exclusively on the $auth parameter, which would point to the impersonated user. The impact is limited to the single user with matching record identifier.

The impact of this issue is mitigated if the table PERMISSIONS clause explicitly checks for an scope that only exists in the specific database (e.g. $scope = "production") or certain claims of the authentication token (e.g. $token.email = "[email protected]"), both of which would remain unchanged in the session of the authenticated user after changing databases. Permissions will default to NONE if there is no PERMISSIONS clause, which also mitigates this impact of this issue.

Patches

  • Version 1.5.4 and later are not affected by this issue.
  • Version 2.0.0-alpha.6 and later will not be affected by this issue.

Workarounds

Users unable to update may want to ensure that table PERMISSIONS clauses explicitly check that the $scope parameter matches a scope that is uniquely named across databases in the same SurrealDB instance. Ensuring that record identifiers for users are automatically generated or explicitly generated to be unique across databases may also be sufficient to mitigate this issue, as the $auth parameter will not link to any user record and any PERMISSIONS clauses restricting authorization based on the authenticated user should fail to successfully evaluate.

References

  • https://github.com/surrealdb/surrealdb/pull/4335

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality low, integrity low, availability low.

Weakness class

CVE-2024-58363 is classified as CWE-287: Improper Authentication. The identity of the caller is not established correctly, so an attacker can act as another user.

Affected software

CVE-2024-58363 is recorded against 3 packages.

  • surrealdb
  • surrealdb-core
  • unknown

Timeline and source

Published on 11 July 2024 and last revised on 19 July 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
github.com (Web)
github.com (Web)
github.com (Package)

Details

Severity Medium
CVSS Score 6.3
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
CWE CWE-287
Public Exploit ✅ No
Source NVD
Published 2024-07-11
Updated 2026-08-12
Modified 2026-07-19
Fix URL N/A

Affected Packages

Software From version Fixed in
surrealdb
surrealdb-core
unknown

Similar Threats

Vulnerability Monitoring

Track new vulnerabilities in surrealdb

CVE-2024-58363 is rated CVSS 6.3 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.