Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1qYzU1LTI0NmMtcjg4Zs4ABBni

SurrealDB has an Uncaught Exception Handling Nonexistent Role

Roles for system users are stored as generic Ident values and converted as strings and into the Role enum whenever IAM operations are to be performed that require processing the user roles. This conversion expects those identifiers to only contain the values owner, editor and viewer and will return an error otherwise. However, the unwrap() method would be called on this result when implementing std::convert::From<&Ident> for Role, which would result in a panic where a nonexistent role was used.

Impact

A privileged user with the owner role at any level in SurrealDB would be able to define a user with DEFINE USER with an nonexistent role, which would panic when being converted to a Role enum in order to perform certain IAM operations with that user. These operations included signing in with the user. This would crash the server, leading to denial of service.

Patches

Unexistent roles are no longer accepted during parsing when defining a user. Even when successfully associated with a user, referencing unexistent roles will no longer result in a panic and will instead throw an InvalidRole error.

Workarounds

Affected users who are unable to update may want to limit access to users with the owner role at any level to trusted parties only. To limit the impact of the denial of service, SurrealDB administrators may also want to ensure that the SurrealDB process is running so that it can be automatically re-started after a crash.

References

Permalink: https://github.com/advisories/GHSA-jc55-246c-r88f
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1qYzU1LTI0NmMtcjg4Zs4ABBni
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 18 days ago
Updated: 18 days ago


CVSS Score: 4.9
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H

Identifiers: GHSA-jc55-246c-r88f
References: Repository: https://github.com/surrealdb/surrealdb
Blast Radius: 10.8

Affected Packages

cargo:surrealdb-core
Dependent packages: 4
Dependent repositories: 0
Downloads: 181,339 total
Affected Version Ranges: < 2.1.0
Fixed in: 2.1.0
All affected versions: 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.3.1, 1.3.2, 1.4.0, 1.4.1, 1.4.2, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4
All unaffected versions: 2.1.0, 2.1.1, 2.1.2
cargo:surrealdb
Dependent packages: 42
Dependent repositories: 158
Downloads: 244,676 total
Affected Version Ranges: < 2.1.0
Fixed in: 2.1.0
All affected versions: 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, 1.2.0, 1.2.2, 1.3.0, 1.3.1, 1.4.0, 1.4.2, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4
All unaffected versions: 2.1.0, 2.1.1, 2.1.2