{"id":"GHSA-27vq-hv74-7cqp","revision":"708e272a6e464538b247d803dabd82e0","records":[{"revision":"708e272a6e464538b247d803dabd82e0","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"GHSA-27vq-hv74-7cqp","aliases":["CVE-2024-58356"],"title":"SurrealDB has Silent Failure to Overwrite Table Definition of Relation Type","description":"The `OVERWRITE` clause of the `DEFINE TABLE` statement would fail to overwrite data for tables that were defined with `TYPE RELATION`. Since table definitions include the `PERMISSIONS` clause, this failure would result in permissions not being overwritten as a result, which may potentially lead users to believe they have changed the table permissions when they have not.\n\n### Impact\n\nIf a user attempted to update table permissions of a table defined with `TYPE RELATION` using `DEFINE TABLE ... OVERWRITE`, permissions for the table would not be changed. This may allow a client that is authorized to run queries in a SurrealDB server to access certain data in that specific table that they were not intended to be able to access after the specified change in permissions.\n\n### Patches\n\nThe `DEFINE TABLE` statement has been updated to appropriately overwrite data for tables defined with `TYPE RELATION`.\n\n- Version 2.1.4 and later are not affected by this issue.\n\n### Workarounds\n\nUsers of tables with `TYPE RELATION` that may have been modified using the `OVERWRITE` clause in order to update permissions are advised to verify that the intended permissions are in place using the `INFO FOR DB` statement. Affected users who are unable to update and require updating permissions in a table with `TYPE RELATION` will be required to remove the table and define it from scratch with the intended permissions. Data can be preserved by backing it up to a temporary table.\n\n### References\n\n- [#5260](https://github.com/surrealdb/surrealdb/pull/5260)","state":0,"publishedAt":"2024-12-16T17:38:53+00:00","modifiedAt":"2026-09-04T19:00:05.4304244+00:00","affected":[{"ecosystem":"crates.io","name":"surrealdb","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"2.0.0"},{"kind":"fixed","version":"2.1.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"crates.io","name":"surrealdb-core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"2.0.0"},{"kind":"fixed","version":"2.1.4"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"LOW"}],"references":["https://github.com/surrealdb/surrealdb/security/advisories/GHSA-27vq-hv74-7cqp","https://nvd.nist.gov/vuln/detail/CVE-2024-58356","https://github.com/surrealdb/surrealdb/pull/5260","https://github.com/surrealdb/surrealdb/commit/2f9a58f830c24f107b4783da1f0704a502bc7734","https://github.com/surrealdb/surrealdb","https://www.vulncheck.com/advisories/surrealdb-before-permission-bypass-via-define-table-overwrite"],"sourceUrl":"https://github.com/advisories/GHSA-27vq-hv74-7cqp","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-27vq-hv74-7cqp","identifiers":["GHSA-27vq-hv74-7cqp","CVE-2024-58356"]},"retained":false,"historicalAffected":[]}],"coverage":[]}