CVE-2024-58358: Surrealdb SurrealDB Has An Uncaught Exception Vulnerability
MODERATECVE-2024-58358 is a MODERATE (CVSS 4.9) surrealdb has an uncaught exception vulnerability (CWE-248: Uncaught Exception) affecting Surrealdb libraries in the crates.io ecosystem. The issue involves surrealdb has an uncaught exception handling nonexistent role. Remediation is available by upgrading affected packages to version 2.1.0.
CVE-2024-58358 at a Glance
Security Impact
CVSS: 4.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2024-58358
To remediate this vulnerability, upgrade all affected Surrealdb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade surrealdb to 2.1.0
Upgrade surrealdb-core to 2.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for surrealdb
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-58358, inspect your project dependencies for Surrealdb:
inspect dependencies for surrealdb
Analyze the terminal output to locate any version of Surrealdb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Surrealdb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-58358 Affected Surrealdb Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
surrealdb
|
crates.io |
< 2.1.0
|
2.1.0
|
|
surrealdb-core
|
crates.io |
< 2.1.0
|
2.1.0
|
References
Frequently Asked Questions
What is CVE-2024-58358?
Which Surrealdb versions are affected?
What version fixes CVE-2024-58358?
Is surrealdb affected?
Is surrealdb-core affected?
What is the CVSS score of CVE-2024-58358?
What CWE is associated with CVE-2024-58358?
How can I check crates.io dependencies for CVE-2024-58358?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jc55-246c-r88f",
"modified" : "2026-09-04T19:20:14Z",
"published" : "2024-11-22T20:11:44Z",
"aliases" : [ "CVE-2024-58358" ],
"summary" : "SurrealDB has an Uncaught Exception Handling Nonexistent Role",
"details" : "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.\n\n### Impact\n\nA 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.\n\n### Patches\n\nUnexistent 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.\n\n- Version 2.1.0 and later are not affected by this issue.\n\n### Workarounds\n\nAffected 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.\n\n### Resourcess\n\n- [#5079](https://github.com/surrealdb/surrealdb/pull/5079)\n- [#5092](https://github.com/surrealdb/surrealdb/pull/5092)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-jc55-246c-r88f"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-58358"
}, {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/pull/5079"
}, {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/pull/5092"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/surrealdb/surrealdb"
}, {
"type" : "WEB",
"url" : "https://www.vulncheck.com/advisories/surrealdb-before-denial-of-service-via-nonexistent-role"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-248" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-11-22T20:11:44Z",
"nvd_published_at" : null
}
}