8.7high
SurrealDB before 1.5.5 Query Injection via RPC API
- Severity
- 8.7high CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.64% (higher than 45% of CVEs)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- GHSA-64f8-pjgr-9wmrGHSA-xw2c-hrr9-4xwr
Description
SurrealDB before 1.5.5 (and 2.0.0-beta before 2.0.0-beta.3) accepts an arbitrary object in the signin and signup operations of the RPC API without recursively validating it for non-computed values. When a record access method defines a SIGNIN or SIGNUP query and the RPC API is exposed to untrusted users, an unauthenticated attacker can encode a binary object containing a subquery using the bincode serialization format and supply it in place of credentials. The subquery is then executed within the database owner's SIGNIN/SIGNUP query under a system user session with the editor role, allowing the attacker to select, create, update, and delete non-IAM resources (though not view the query results directly, and not affect IAM resources, which require the owner role).
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| surrealdb surrealdb | before 1.5.5, from 2.0.0-beta.1 before 2.0.0-beta.3, before 1.5.2, 2.0.0 Not affected: 1.5.5, 2.0.0-beta.3, 1.5.2 | CVE List, NVD |
| surrealdb (crates.io) | before 1.5.5, from 2.0.0-beta.1 before 2.0.0-beta.3, all versions | GitHub Advisory Database |
| surrealdb-core (crates.io) | before 1.5.2 | GitHub Advisory Database |
All scores
| VulnCheck | 8.7high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| VulnCheck | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
SurrealDB before 1.5.5 (and 2.0.0-beta before 2.0.0-beta.3) accepts an arbitrary object in the signin and signup operations of the RPC API without recursively validating it for non-computed values. When a record access method defines a SIGNIN or SIGNUP query and the RPC API is exposed to untrusted users, an unauthenticated attacker can encode a binary object containing a subquery using the bincode serialization format and supply it in place of credentials. The subquery is then executed within the database owner's SIGNIN/SIGNUP query under a system user session with the editor role, allowing the attacker to select, create, update, and delete non-IAM resources (though not view the query results directly, and not affect IAM resources, which require the owner role).
GitHub Advisory Database
During the sign in and sign up operations through the SurrealDB RPC API, an arbitrary object would be accepted in order to support a wide array of types and structures that could contain user credentials. This arbitrary object could potentially contain any SurrealDB value, including an object representing a subquery. For this to materialize, this object would need to be encoded using the bincode serialization format instead of the default JSON serialization format or the additionally supported CBOR serialization format.
If a binary object containing a subquery were to be provided in this way, that subquery would be computed while executing the SIGNIN and SIGNUP queries defined by the database owner while defining a record access method. Since those queries are executed under a system user session with the editor role, an unauthenticated attacker may be able to leverage this behavior to select, create, update and delete non-IAM resources with permissions of a system user with the editor role.
Impact
If a record access method was defined with a SIGNIN or a SIGNUP query and the SurrealDB RPC API was exposed to untrusted users, an attacker could be able to craft a binary object containing a subquery to provide in place of valid credentials when calling the signin and signup operations via the RPC API with the bincode serialization format. The attacker could use that subquery to select, create, update and delete resources in SurrealDB, but they would not be able to directly view the results of the query. This method cannot be used to create, update or delete IAM resources, as access to those kind of resources requires the owner role.
Patches
Objects provided as variables to the sign in and sign up methods are now recursively validated to ensure that they do not contain any non-computed values, which include subqueries and other data types that could potentially result in query execution.
- Version 1.5.5 and later are not affected by this issue.
- Version 2.0.0-beta.3 and later are not affected by this issue.
Workarounds
Users unable to update may want to disallow access to the SurrealDB RPC API using the affected binary serialization formats by conservatively allowing only requests to the /rpc endpoint of the SurrealDB HTTP server with the application/json content type. If the RPC API is not used at all or only used by trusted clients, disallowing or restricting access to the /rpc endpoint of the SurrealDB HTTP server will also prevent exploitation. Alternatively, if filtering HTTP requests is not possible, record access methods that define SIGNIN and SIGNUP clauses may be temporarily removed to completely prevent potential attacks leveraging this issue.
References
GitHub Advisory Database
Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-64f8-pjgr-9wmr. This link is maintained to preserve external references.
Original Description
SurrealDB before 1.5.5 (and 2.0.0-beta before 2.0.0-beta.3) accepts an arbitrary object in the signin and signup operations of the RPC API without recursively validating it for non-computed values. When a record access method defines a SIGNIN or SIGNUP query and the RPC API is exposed to untrusted users, an unauthenticated attacker can encode a binary object containing a subquery using the bincode serialization format and supply it in place of credentials. The subquery is then executed within the database owner's SIGNIN/SIGNUP query under a system user session with the editor role, allowing the attacker to select, create, update, and delete non-IAM resources (though not view the query results directly, and not affect IAM resources, which require the owner role).
NVD (es)
SurrealDB antes de 1.5.5 (y 2.0.0-beta antes de 2.0.0-beta.3) acepta un objeto arbitrario en las operaciones de inicio de sesión y registro de la API RPC sin validarlo recursivamente para valores no calculados. Cuando un método de acceso a registros define una consulta SIGNIN o SIGNUP y la API RPC está expuesta a usuarios no confiables, un atacante no autenticado puede codificar un objeto binario que contiene una subconsulta utilizando el formato de serialización bincode y proporcionarlo en lugar de las credenciales. La subconsulta se ejecuta entonces dentro de la consulta SIGNIN/SIGNUP del propietario de la base de datos bajo una sesión de usuario del sistema con el rol de editor, permitiendo al atacante seleccionar, crear, actualizar y eliminar recursos que no son IAM (aunque no puede ver los resultados de la consulta directamente, y no afecta a los recursos IAM, que requieren el rol de propietario).
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-58362 changed 2026-07-28 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-64f8-pjgr-9wmr changed 2026-07-19 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-xw2c-hrr9-4xwr changed 2026-09-04 | CC-BY-4.0 |
| NVD | CVE-2024-58362 changed 2026-10-27 | Public domain |