# CVE-2024-58358: SurrealDB denial of service via nonexistent role conversion

Source: https://junglewise.ai/threats/cve-2024-58358-surrealdb-denial-of-service-via-nonexistent-role-conversion  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-18. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2024-58358 · Severity: medium · CVSS 4.9 · Published 2026-07-18

SurrealDB is a multi-model database platform. An administrator with owner privileges can create database user accounts with invalid role names. When these accounts are used (such as during sign-in), the server crashes instead of gracefully rejecting the invalid role, causing the database to become unavailable. This requires privileged access but results in a complete denial of service.

Technologies: [surrealdb (crates.io)](https://junglewise.ai/threats/technologies/surrealdb), [surrealdb-core (crates.io)](https://junglewise.ai/threats/technologies/crates-io-surrealdb-core), [Surrealdb-Core](https://junglewise.ai/threats/technologies/surrealdb-core). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io), [SurrealDB](https://junglewise.ai/threats/vendors/surrealdb).

## Quick answers

**Is CVE-2024-58358 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-58358 being exploited in the wild.

**How severe is CVE-2024-58358?** Medium severity, with a CVSS score of 4.9, published 18 July 2026.

**Which products and versions are affected?** surrealdb (crates.io) < 2.1.0, SEMVER:introduced=0,fixed=2.1.0; surrealdb-core (crates.io) SEMVER:introduced=0,fixed=2.1.0; Surrealdb-Core < 2.1.0.

**Is there a fix for CVE-2024-58358?** Yes. surrealdb (crates.io): upgrade to 2.1.0 or later; surrealdb-core (crates.io): upgrade to 2.1.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-58358 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2024-58358?** Check whether you run surrealdb (crates.io), surrealdb-core (crates.io) or Surrealdb-Core at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- surrealdb (crates.io): upgrade to 2.1.0 or later

  ```sh
  cargo update -p surrealdb
  ```

- surrealdb-core (crates.io): upgrade to 2.1.0 or later

  ```sh
  cargo update -p surrealdb-core
  ```


## Technical details

The vulnerability exists in SurrealDB's role conversion logic. System user roles are stored as generic Ident values and must be converted to a Role enum during IAM operations. The conversion expects only three valid roles: owner, editor, and viewer. However, the From trait implementation calls unwrap() on the conversion result without validation, causing a panic when an invalid role name is encountered. A privileged owner-role user can exploit this by defining a user with a nonexistent role using the DEFINE USER statement. When that user attempts to sign in or other IAM operations reference the invalid role, the server panics, causing denial of service. The fix (available in version 2.1.0+) validates roles during parsing and returns an InvalidRole error instead of panicking.

## Affected products

- SurrealDB SurrealDB < 2.1.0
- SurrealDB surrealdb-core < 2.1.0

## Identifiers

- CVE-2024-58358
- GHSA-jc55-246c-r88f

## Timeline

- 2024-11-22: disclosed: Vulnerability disclosed via GitHub Advisory
- 2024-11-22: patched: Fix available in version 2.1.0

## References

- [https://api.github.com/users/garyhai](https://api.github.com/users/garyhai)
- [https://github.com/garyhai](https://github.com/garyhai)
- [https://api.github.com/users/garyhai/gists%7B/gist_id%7D](https://api.github.com/users/garyhai/gists%7B/gist_id%7D)
- [https://api.github.com/users/garyhai/repos](https://api.github.com/users/garyhai/repos)
- [https://avatars.githubusercontent.com/u/177827?v=4](https://avatars.githubusercontent.com/u/177827?v=4)
- [https://api.github.com/users/garyhai/events%7B/privacy%7D](https://api.github.com/users/garyhai/events%7B/privacy%7D)

## Related threats

- [SurrealDB use-after-free in KV backends via affinitypool spawn_local](https://junglewise.ai/threats/cve-2026-121417-surrealdb-before-3-3-0-contains-a-use-after-free-vulnerability)
- [RUSTSEC-2026-0454 - Data race and double free via unsound `Send`/`Sync` in `reblessive`](https://junglewise.ai/threats/rustsec-2026-0454-data-race-and-double-free-via-unsound-send-sync-in-b23614bb)
- [SurrealDB JSON parser denial of service via uncontrolled recursion](https://junglewise.ai/threats/surrealdb-json-parser-denial-of-service-via-uncontrolled-recursion-3037f8a0)
- [SurrealDB ES512 algorithm silently downgraded to ES384](https://junglewise.ai/threats/surrealdb-es512-algorithm-silently-downgraded-to-es384-f0af29b8)
- [SurrealDB permission bypass via WHERE clause evaluation](https://junglewise.ai/threats/surrealdb-permission-bypass-via-where-clause-evaluation-afa6f001)
