SurrealDB versions from 3.2.0 up to but not including 3.3.4 have an authorization bypass vulnerability. This flaw allows record users to update protected rows by exploiting how update permissions are checked against computed fields. The permission check occurs before computed fields are populated, causing deny-intended predicates to incorrectly pass and enabling unauthorized modifications.
An improper authentication vulnerability exists in better-auth versions 0.4.12-beta.7 before 1.7.16 and 1.8.0-beta.0 before 1.8.0-beta.5 in the phone number plugin. This flaw allows sign-up and other flows to save unverified phone numbers, which are then used by phone OTP sign-in to select accounts. An attacker can exploit this by associating a victim's phone number with an attacker-controlled account, causing the victim's valid OTP sign-in to yield a session for the attacker's account and potentially exposing data the victim enters.
better-auth versions 1.3.7 before 1.7.16 and 1.8.0-beta.0 before 1.8.0-beta.5 contain a race condition vulnerability in the emailOTP plugin. This flaw allows unauthenticated attackers to bypass allowed attempt limits by sending concurrent guesses, potentially enabling brute-force attacks on one-time passwords (OTPs) for sign-in or password resets. Additionally, signed-in users can verify email addresses they do not own, and attackers receiving mail at accent-variant email addresses can reset victims' passwords.
@better-auth/passkey versions 1.4.0-beta.16 before 1.7.16 and 1.8.0-beta.0 before 1.8.0-beta.5, along with the passkey plugin in better-auth versions 1.2.0-beta.18 before 1.4.0, do not properly enforce WebAuthn user verification when it is set to "required". They also incorrectly take the expected origin from the request rather than from a secure configuration. This flaw allows users to register or authenticate using passkeys without the necessary PIN or biometric verification, and passkey responses from another origin under the same relying party ID may be accepted.
@better-auth/stripe versions 1.2.0-beta.18 before 1.7.16 and 1.8.0-beta.0 before 1.8.0-beta.5 contain an authorization bypass vulnerability. This flaw allows users to replace their Stripe customer ID with another customer's ID via sign-up or update-user requests. Exploitation enables attackers who know another customer's Stripe ID to access that customer's billing portal, view invoices and billing details, change payment methods, and modify or cancel subscriptions.
better-auth versions 1.5.5 before 1.7.16 and 1.8.0-beta.0 before 1.8.0-beta.5 contain a privilege escalation vulnerability in the organization plugin. The flaw arises because the creator role check compares the raw invitation role string, while subsequent checks trim whitespace. This allows an attacker with invite permissions to submit a padded role string (e.g., " owner") that is accepted as an owner role upon invitation acceptance. Exploitation can lead to deletion of the organization and removal of original owners.
@better-auth/electron versions 1.5.0-beta.12 before 1.7.16 and 1.8.0-beta.0 before 1.8.0-beta.5 have a vulnerability where any validly signed transfer cookie is accepted, exposing full endpoint context including authentication secrets. Authenticated users can extract these secrets to forge sessions as other users. Additionally, attackers who know a password can bypass two-factor authentication by exchanging desktop authorization codes issued before two-factor verification.
Better Auth versions before 1.7.16 and 1.8.0-beta.0 before 1.8.0-beta.5 have a race condition vulnerability involving MySQL or MariaDB serial IDs. The issue arises because the inserted row's ID is retrieved using a separate LAST_INSERT_ID() query that may execute on a different pooled connection. Under concurrent load, this can cause a user signing in to receive another user's session, allowing session hijacking.
SurrealDB versions from 3.0.0 up to but not including 4.0.0 contain a path traversal vulnerability in the bucket storage layer on Windows. The vulnerability arises because the traversal check only splits object keys on forward slashes, while the file system treats backslashes as directory separators. This allows attackers to craft object keys that bypass the traversal check and access or modify files in other buckets.
SurrealDB versions from 1.0.0 up to but not including 4.0.0 contain a denial of service vulnerability. This flaw allows any user with query execution privileges to crash the server by causing an unchecked decimal overflow in certain mathematical operations. Specifically, queries that sum or multiply large decimal literals or aggregate stored decimals using GROUP ALL can trigger a panic in the rust_decimal library, terminating the server process.
SurrealDB versions 3.0.0 up to but not including 4.0.0 contain a path traversal vulnerability in the handling of direct filesystem buckets. This flaw allows an authenticated tenant with restricted key permissions to bypass access controls by using crafted keys with path traversal sequences, enabling unauthorized read, write, or deletion of arbitrary files within the storage root.
SurrealDB versions from 2.2.0 up to but not including 4.0.0 expose record IDs of referencing rows in error messages when a delete operation is blocked by an ON DELETE REJECT reference. This exposure occurs without verifying the caller's SELECT permission on those referencing rows. As a result, an authenticated user with DELETE permission can infer the existence and exact IDs of referencing records that would otherwise be hidden by row-level SELECT restrictions.
SurrealDB versions 3.0.4 up to but not including 4.0.0 have a vulnerability in the GraphQL WebSocket upgrade handler at GET /graphql. The operator-configured limits for WebSocket frame, message, and buffer sizes are not enforced, causing the system to fall back to permissive library defaults. This allows unauthenticated remote attackers to send large amounts of data (up to 64 MiB per connection) by specifying the target namespace and database in request headers, potentially exhausting server memory and degrading availability.
SurrealDB versions 3.0.0 up to but not including 4.0.0 contain a path traversal vulnerability in the filesystem storage bucket. The vulnerability arises because the bucket root is canonicalized, but descendant symbolic links are not, allowing attackers to bypass lexical prefix checks. This enables unauthorized reading and writing of files across the host filesystem.
SurrealDB versions from 1.0.0 up to but not including 4.0.0 have a vulnerability in their embedded JavaScript engine that allows authenticated users to bypass capability checks. This occurs because the surrealdb.functions bridge calls internal dispatchers without enforcing function capability restrictions, enabling unauthorized execution of built-in SurrealQL functions.
SurrealDB versions from 3.1.0 up to but not including 4.0.0 contain an SQL injection vulnerability in the Model Context Protocol (MCP) server. The flaw arises because the identifier validator mishandles escaped backticks, allowing attackers to break out of quoted identifiers and execute arbitrary SurrealQL statements. This vulnerability has a high severity rating with a CVSS score of 8.2.
SurrealDB versions from 1.0.0 up to but not including 4.0.0 expose sensitive environment variable values (SURREAL_PASS and SURREAL_TOKEN) in clear text in the CLI help output. This occurs because the CLI commands do not hide environment variable values when displaying help, potentially exposing root database credentials to anyone who can view terminal outputs such as shell logs, CI logs, or screen shares.
SurrealDB versions 3.0.0 up to but not including 4.0.0 contain an authorization bypass vulnerability. This flaw allows users assigned the read-only VIEWER role to modify the database schema by implicitly creating new tables without proper permission checks. Specifically, issuing CREATE statements on nonexistent tables in non-STRICT mode adds arbitrary empty schemaless tables, potentially cluttering the schema or causing conflicts with application tables.
SurrealDB versions from 2.2.0 up to but not including 4.0.0 contain an authorization bypass vulnerability in the Document::purge_references function. This flaw allows authenticated users to bypass table-level delete and update permissions by exploiting REFERENCE ON DELETE cascades. As a result, attackers can delete or modify referencing records or execute custom expressions despite restrictive permissions.
SurrealDB versions 3.0.0 up to but not including 4.0.0 contain a permission bypass vulnerability. Authenticated users with low privileges can exploit the GET /export endpoint to read restricted records. This bypass allows attackers to access raw records without enforcement of table-level SELECT predicates and field-level SELECT permissions, exposing data that should be hidden.