{"id":"CVE-2024-58358","aliases":["CVE-2024-58358","GHSA-jc55-246c-r88f"],"related":[],"kind":"vulnerability","state":"published","title":"SurrealDB before 2.1.0 Denial of Service via Nonexistent Role","summary":"SurrealDB versions before 2.1.0 contain a denial of service vulnerability in role conversion that allows privileged owner users to define users with nonexistent roles. Attackers can trigger an uncaught panic by signing in with a user assigned an invalid role, crashing the server.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SurrealDB versions before 2.1.0 contain a denial of service vulnerability in role conversion that allows privileged owner users to define users with nonexistent roles. Attackers can trigger an uncaught panic by signing in with a user assigned an invalid role, crashing the server.","source":"cvelist"},{"lang":"en","text":"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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Versiones de SurrealDB anteriores a la 2.1.0 contienen una vulnerabilidad de denegación de servicio en la conversión de roles que permite a usuarios propietarios privilegiados definir usuarios con roles inexistentes. Los atacantes pueden desencadenar un pánico no capturado al iniciar sesión con un usuario al que se le asignó un rol inválido, colapsando el servidor.","source":"nvd"}],"published":"2024-11-22T20:11:44.000Z","modified":"2026-10-27T18:10:00.130Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H","score":4.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H","score":4.9,"rating":"MEDIUM"}],"cwes":["CWE-248"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"2.1.0","status":"affected"},{"type":"semver","version":"2.1.0","status":"unaffected"}],"vendor":"surrealdb","product":"surrealdb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","fixed":"2.1.0","status":"affected"},{"type":"semver","version":"2.1.0","status":"unaffected"}],"vendor":"surrealdb","product":"surrealdb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.0"}],"ecosystem":"crates.io","package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.0"}],"ecosystem":"crates.io","package":"surrealdb-core","purl":"pkg:cargo/surrealdb-core","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.1.0"}],"vendor":"surrealdb","product":"surrealdb","cpe":"cpe:2.3:a:surrealdb:surrealdb:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/surrealdb/surrealdb/security/advisories/GHSA-jc55-246c-r88f","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/surrealdb-before-denial-of-service-via-nonexistent-role","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58358","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/surrealdb/surrealdb/pull/5079","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/surrealdb/surrealdb/pull/5092","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/surrealdb/surrealdb","tags":["package"],"sources":["ghsa"]}],"credits":["garyhai"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-20T13:40:16.867Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-58358","url":"https://www.cve.org/CVERecord?id=CVE-2024-58358","licence":"CVE Terms of Use","modified":"2026-07-28T01:47:47.875Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jc55-246c-r88f","url":"https://github.com/advisories/GHSA-jc55-246c-r88f","licence":"CC-BY-4.0","modified":"2026-09-04T19:30:04.166Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-58358","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58358","licence":"Public domain","modified":"2026-10-27T18:10:00.130Z"}],"updatedAt":"2026-11-25T22:58:53.048Z","epss":{"score":0.00329,"percentile":0.28026,"date":"2026-12-01T12:00:22.000Z"}}