{"id":"CVE-2024-58359","revision":null,"records":[{"revision":"91ee9c29286c467aaf822ffb993c49a7","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2024-58359","aliases":[],"title":"SurrealDB before 2.1.0 Denial of Service via rand() Sorting","description":"SurrealDB versions before 2.1.0 contain a denial of service vulnerability in the sorting mechanism when using ORDER BY rand() clause. Authorized clients can execute queries with ORDER BY rand() to trigger a panic in the sorting function, crashing the server.","state":0,"publishedAt":"2026-07-18T13:10:02.92+00:00","modifiedAt":"2026-07-28T01:47:48.525+00:00","affected":[{"ecosystem":"Vendor product","name":"surrealdb","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"surrealdb\",\n                    \"product\": \"surrealdb\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"packageURL\": \"pkg:cargo/surrealdb\",\n                    \"versions\": [\n                        {\n                            \"version\": \"0\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"semver\",\n                            \"lessThan\": \"2.1.0\"\n                        },\n                        {\n                            \"version\": \"2.1.0\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"surrealdb","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"surrealdb\",\n                    \"product\": \"surrealdb\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"packageURL\": \"pkg:cargo/surrealdb-core\",\n                    \"versions\": [\n                        {\n                            \"version\": \"0\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"semver\",\n                            \"lessThan\": \"2.1.0\"\n                        },\n                        {\n                            \"version\": \"2.1.0\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":7.1,"severity":"HIGH"},{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"severity":"MEDIUM"}],"references":["https://github.com/surrealdb/surrealdb/security/advisories/GHSA-m52v-24p8-654f","https://www.vulncheck.com/advisories/surrealdb-before-denial-of-service-via-rand-sorting"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2024-58359","license":"CVE Program Terms of Use","key":"cve-program:CVE-2024-58359","identifiers":["CVE-2024-58359"]},"retained":false,"historicalAffected":[]},{"revision":"f69906cc865540ef9d68ae10380f0e7e","observedAt":"2026-10-29T21:24:35.901+00:00","statement":{"source":"euvd","id":"EUVD-2024-55676","aliases":["CVE-2024-58359","GHSA-gjm5-72ch-9675"],"title":"SurrealDB versions before 2.1.0 contain a denial of service vulnerability in the sorting mechanism when using ORDER BY rand() clause. Authorized clients can execute queries with ORDER BY rand() to trigger a panic in the sorting function, cr…","description":"SurrealDB versions before 2.1.0 contain a denial of service vulnerability in the sorting mechanism when using ORDER BY rand() clause. Authorized clients can execute queries with ORDER BY rand() to trigger a panic in the sorting function, crashing the server.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":7.1,"severity":null}],"references":["https://github.com/surrealdb/surrealdb/security/advisories/GHSA-m52v-24p8-654f","https://www.vulncheck.com/advisories/surrealdb-before-denial-of-service-via-rand-sorting"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2024-55676","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Jul 18, 2026, 1:10:02 PM","dateUpdated":"Jul 28, 2026, 1:47:48 AM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2024-55676","identifiers":["EUVD-2024-55676","CVE-2024-58359","GHSA-gjm5-72ch-9675"]},"retained":false,"historicalAffected":[]},{"revision":"2c18d9459c274e019262aad79a237cac","observedAt":"2026-10-29T03:27:18.135+00:00","statement":{"source":"nvd","id":"CVE-2024-58359","aliases":[],"title":"SurrealDB versions before 2.1.0 contain a denial of service vulnerability in the sorting mechanism when using ORDER BY rand() clause. Authorized clients can execute queries with ORDER BY rand() to trigger a panic in the sorting function, cr…","description":"SurrealDB versions before 2.1.0 contain a denial of service vulnerability in the sorting mechanism when using ORDER BY rand() clause. Authorized clients can execute queries with ORDER BY rand() to trigger a panic in the sorting function, crashing the server.","state":0,"publishedAt":"2026-07-18T14:17:08.78+00:00","modifiedAt":"2026-10-27T18:10:00.13+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · disclosure@vulncheck.com · Secondary","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/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","score":7.1,"severity":"HIGH"},{"system":"CVSS 3.1 · disclosure@vulncheck.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"severity":"MEDIUM"}],"references":["https://github.com/surrealdb/surrealdb/security/advisories/GHSA-m52v-24p8-654f","https://www.vulncheck.com/advisories/surrealdb-before-denial-of-service-via-rand-sorting"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2024-58359","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-248"],"productCriteria":["cpe:2.3:a:surrealdb:surrealdb:*:*:*:*:*:*:*:*"],"sourceDates":{"published":"2026-07-18T14:17:08.780","lastModified":"2026-10-27T18:10:00.130"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2024-58359","identifiers":["CVE-2024-58359"]},"retained":false,"historicalAffected":[]},{"revision":"f25889dcb77e495ba85e0d3986028b0e","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"GHSA-m52v-24p8-654f","aliases":["CVE-2024-58359"],"title":"SurrealDB has an Uncaught Exception Sorting Tables by Random Order","description":"Sorting table records using an `ORDER BY` clause with the `rand()` function as sorting mechanism could cause a panic due to relying on a comparison function that did not implement total order. This event resulted in a panic due to a recent [change in Rust 1.81](https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html#new-sort-implementations).\n\n### Impact\n\nA client that is authorized to run queries in a SurrealDB server would be able to query a table with `ORDER BY rand()` in order to potentially cause a panic in the sorting function. This would crash the server, leading to denial of service.\n\n### Patches\n\nThe sorting algorithm has been updated to guarantee total order when shuffling records.\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 the ability of untrusted clients to run arbitrary SurrealQL queries in the affected versions of SurrealDB. 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### References\n\n- https://github.com/surrealdb/surrealdb/issues/4969\n- https://github.com/surrealdb/surrealdb/pull/4989\n- https://github.com/surrealdb/surrealdb/pull/4805\n- https://github.com/surrealdb/surrealdb/pull/4906","state":0,"publishedAt":"2024-11-22T20:11:48+00:00","modifiedAt":"2026-07-19T03:56:47.7312176+00:00","affected":[{"ecosystem":"crates.io","name":"surrealdb","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"2.1.0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"crates.io","name":"surrealdb-core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"2.1.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/surrealdb/surrealdb/security/advisories/GHSA-m52v-24p8-654f","https://github.com/surrealdb/surrealdb/issues/4969","https://github.com/surrealdb/surrealdb/pull/4805","https://github.com/surrealdb/surrealdb/pull/4906","https://github.com/surrealdb/surrealdb/pull/4989","https://github.com/surrealdb/surrealdb"],"sourceUrl":"https://github.com/advisories/GHSA-m52v-24p8-654f","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-m52v-24p8-654f","identifiers":["GHSA-m52v-24p8-654f","CVE-2024-58359"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-30T21:45:26.8921006+00:00","complete":true,"records":1766,"lastAttemptAt":"2026-10-30T21:45:26.8921006+00:00","lastSuccessAt":"2026-10-30T21:45:27.0564442+00:00","error":null,"lastVerifiedAt":"2026-10-30T21:45:27.0564449+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-7e2c4e7288f2c464ad8c61f3bb6017374714faedcc781283ac06a706ee1a820b-fe2415543f6176e43180f3324a663ce61f6ebd2e6917542e40176ff2e9495143","complete":true,"records":417364,"lastAttemptAt":"2026-10-30T21:45:26.2908791+00:00","lastSuccessAt":"2026-10-30T19:45:36.3062344+00:00","error":null,"lastVerifiedAt":"2026-10-30T21:45:26.2908791+00:00","snapshotPublishedAt":"2026-10-30T19:18:05+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-63f69305b6a343b791b305fac5c9c952","complete":false,"records":13533,"lastAttemptAt":"2026-10-30T21:57:59.5096056+00:00","lastSuccessAt":"2026-10-30T21:57:59.506+00:00","error":"80 identifier lookups failed; latest failures include request timeout. Other identifiers were checked independently.","lastVerifiedAt":"2026-10-30T21:57:59.506+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13422,"expectedIdentifiers":13605,"failedIdentifiers":80},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-30T21:45:26.8921006+00:00","complete":true,"records":1094,"lastAttemptAt":"2026-10-30T21:45:26.8921006+00:00","lastSuccessAt":"2026-10-30T21:45:27.0572356+00:00","error":null,"lastVerifiedAt":"2026-10-30T21:45:27.0572357+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-340eea54e9164cca8ca7627a28dfdbb6","complete":false,"records":13545,"lastAttemptAt":"2026-10-30T21:45:52.4135469+00:00","lastSuccessAt":"2026-10-30T21:45:52.407+00:00","error":null,"lastVerifiedAt":"2026-10-30T21:45:52.407+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13599,"expectedIdentifiers":13605,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-311dd376326605484703c43905ee6a0126d56b980059b1c691182fb1a6e71c84","complete":true,"records":9808,"lastAttemptAt":"2026-10-30T21:45:26.8285672+00:00","lastSuccessAt":"2026-10-30T19:45:46.4838995+00:00","error":null,"lastVerifiedAt":"2026-10-30T21:45:26.8285672+00:00","snapshotPublishedAt":"2026-10-30T18:48:16+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-2de9ccc5290f060c7aa63f89c25dd76f655a64ba1aba7c05c97fa3bee4f09899","complete":true,"records":1967,"lastAttemptAt":"2026-10-30T21:45:26.4381246+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-10-30T21:45:26.4381246+00:00","snapshotPublishedAt":"2026-10-28T20:03:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-f7956b0b80c3f12706a4454a1e0aea0c83c0a5730f2cff4597eb5c4eedd05097","complete":true,"records":3023,"lastAttemptAt":"2026-10-30T21:45:26.8438359+00:00","lastSuccessAt":"2026-10-30T17:47:18.9941876+00:00","error":null,"lastVerifiedAt":"2026-10-30T21:45:26.8438359+00:00","snapshotPublishedAt":"2026-10-30T15:48:06+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-a12b17cc91216d5a280d5a5e257a4bc61a7e8824cd7f389e730ce6d1147fa887","complete":true,"records":230969,"lastAttemptAt":"2026-10-30T21:45:26.6245171+00:00","lastSuccessAt":"2026-10-30T18:47:14.1288263+00:00","error":null,"lastVerifiedAt":"2026-10-30T21:45:26.6245171+00:00","snapshotPublishedAt":"2026-10-30T18:33:11+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}