CVE-2024-58363

SurrealDB before 1.5.4 Authentication Bypass via Database Switch

Published Jul 18, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
SurrealDB before 1.5.4 and 2.0.0-alpha.1 before 2.0.0-alpha.6 fails to properly validate authentication when a scope user switches databases using the USE clause or use method. Attackers with an authenticated session can impersonate an unrelated user in a different database if a user record with an identical identifier exists, allowing unauthorized actions if permissions rely solely on the $auth parameter.

Analysis

AI-generated

Technical impact

The vulnerability occurs because SurrealDB does not properly validate the authenticated context when a user changes the active database using the USE clause or the equivalent method. An attacker who has a valid authenticated session can switch to a database where a user record with a matching identifier exists, thereby impersonating that user if permissions are granted solely based on the $auth token. This allows the attacker to perform any action the impersonated user is permitted to do, such as reading, modifying or deleting data. The flaw is an authentication bypass, identified as CWE-287, enabling unauthorized access to data that should be protected by the $auth parameter.

Affected Systems

This issue affects SurrealDB deployments running any version prior to 1.5.4 and the 2.0.0-alpha series before 2.0.0-alpha.6. The product is the SurrealDB database engine (surrealdb:surrealdb), and the flaw manifests when a user record with the same identifier exists in multiple databases. Vulnerable builds include surrealdb:surrealdb and surrealdb:surrealdb-core.

Risk and Exploitability

The CVSS score of 5.3 denotes moderate severity, while the EPSS score of less than 1% indicates a low probability of exploitation in the wild. The vulnerability is not listed in CISA’s KEV catalog. Exploitation requires an attacker to first acquire a valid authenticated session on the SurrealDB instance, then issue a USE directive that points to a database containing a user record with the same identifier. Once the context switches, the attacker can act as that user, thereby accessing functionality that depends solely on the $auth token. The attack vector is therefore limited to authenticated users and does not involve remote code execution or privilege escalation from an unauthenticated state.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade SurrealDB to version 1.5.4 or newer to apply the authentication validation fix.
  • Ensure that each user identifier is unique across databases, or otherwise adjust the permission model so that the $auth value alone does not grant cross-database access.
  • Restrict or disable the USE clause (or database switching) for non-trusted roles if possible, or apply network segmentation to limit exposure of the database service.

Generated by OpenCVE AI on October 29, 2026 at 23:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description SurrealDB before 1.5.4 fails to properly validate authentication when a scope user switches databases using the USE clause or use method. Attackers with an authenticated session can impersonate an unrelated user in a different database if a user record with an identical identifier exists, allowing unauthorized actions if permissions rely solely on the $auth parameter. SurrealDB before 1.5.4 and 2.0.0-alpha.1 before 2.0.0-alpha.6 fails to properly validate authentication when a scope user switches databases using the USE clause or use method. Attackers with an authenticated session can impersonate an unrelated user in a different database if a user record with an identical identifier exists, allowing unauthorized actions if permissions rely solely on the $auth parameter.
Type Values Removed Values Added
CPEs cpe:2.3:a:surrealdb:surrealdb:2.0.0:alpha1:*:*:*:*:*:*
cpe:2.3:a:surrealdb:surrealdb:2.0.0:alpha2:*:*:*:*:*:*
cpe:2.3:a:surrealdb:surrealdb:2.0.0:alpha3:*:*:*:*:*:*
cpe:2.3:a:surrealdb:surrealdb:2.0.0:alpha4:*:*:*:*:*:*
cpe:2.3:a:surrealdb:surrealdb:2.0.0:alpha5:*:*:*:*:*:*
Type Values Removed Values Added
CPEs cpe:2.3:a:surrealdb:surrealdb:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Surrealdb
Surrealdb surrealdb
Vendors & Products Surrealdb
Surrealdb surrealdb
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description SurrealDB before 1.5.4 fails to properly validate authentication when a scope user switches databases using the USE clause or use method. Attackers with an authenticated session can impersonate an unrelated user in a different database if a user record with an identical identifier exists, allowing unauthorized actions if permissions rely solely on the $auth parameter.
Title SurrealDB before 1.5.4 Authentication Bypass via Database Switch
Weaknesses CWE-287
References
Metrics cvssV3_1

{'score': 6.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L'}

cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 29, 2026, 9:15 PM
Reserved
Jul 18, 2026, 12:40 PM
Status
Modified
Published
Jul 18, 2026, 2:17 PM
Modified
Oct 29, 2026, 9:17 PM