{"id":"CVE-2024-58356","aliases":["CVE-2024-58356","GHSA-27vq-hv74-7cqp"],"related":[],"kind":"vulnerability","state":"published","title":"SurrealDB before 2.1.4 Permission Bypass via DEFINE TABLE OVERWRITE","summary":"SurrealDB before 2.1.4 silently fails to overwrite table definitions when the DEFINE TABLE ... OVERWRITE clause is used on tables defined with TYPE RELATION. Because table definitions include the PERMISSIONS clause, an attempt to tighten a table's permissions via OVERWRITE does not take effect, and the administrator may incorrectly believe the change was applied. As a result, a client authorized to run queries may continue to access data in that table that the updated (but unapplied) permissions were intended to restrict.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SurrealDB before 2.1.4 silently fails to overwrite table definitions when the DEFINE TABLE ... OVERWRITE clause is used on tables defined with TYPE RELATION. Because table definitions include the PERMISSIONS clause, an attempt to tighten a table's permissions via OVERWRITE does not take effect, and the administrator may incorrectly believe the change was applied. As a result, a client authorized to run queries may continue to access data in that table that the updated (but unapplied) permissions were intended to restrict.","source":"cvelist"},{"lang":"en","text":"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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"SurrealDB anterior a la versión 2.1.4 falla silenciosamente al sobrescribir definiciones de tabla cuando se utiliza la cláusula DEFINE TABLE ... OVERWRITE en tablas definidas con TYPE RELATION. Debido a que las definiciones de tabla incluyen la cláusula PERMISSIONS, un intento de restringir los permisos de una tabla a través de OVERWRITE no surte efecto, y el administrador puede creer incorrectamente que el cambio se aplicó. Como resultado, un cliente autorizado para ejecutar consultas puede continuar accediendo a datos en esa tabla que los permisos actualizados (pero no aplicados) estaban destinados a restringir.","source":"nvd"}],"published":"2024-12-16T17:38:53.000Z","modified":"2026-10-27T18:10:00.130Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","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":2.3,"rating":"LOW"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","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":2.3,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L","score":6.3,"rating":"MEDIUM"}],"cwes":["CWE-276","CWE-732"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"2.1.4","status":"affected"},{"type":"semver","version":"2.1.4","status":"unaffected"}],"vendor":"surrealdb","product":"surrealdb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","fixed":"2.1.4","status":"affected"},{"type":"semver","version":"2.1.4","status":"unaffected"}],"vendor":"surrealdb","product":"surrealdb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"2.1.4"}],"ecosystem":"crates.io","package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"2.1.4"}],"ecosystem":"crates.io","package":"surrealdb-core","purl":"pkg:cargo/surrealdb-core","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.0.0","fixed":"2.1.4"}],"vendor":"surrealdb","product":"surrealdb","cpe":"cpe:2.3:a:surrealdb:surrealdb:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/surrealdb/surrealdb/security/advisories/GHSA-27vq-hv74-7cqp","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/surrealdb-before-permission-bypass-via-define-table-overwrite","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58356","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/surrealdb/surrealdb/pull/5260","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/surrealdb/surrealdb/commit/2f9a58f830c24f107b4783da1f0704a502bc7734","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/surrealdb/surrealdb","tags":["package"],"sources":["ghsa"]}],"credits":["AlbertMarashi"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-20T19:23:39.284Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-58356","url":"https://www.cve.org/CVERecord?id=CVE-2024-58356","licence":"CVE Terms of Use","modified":"2026-07-28T01:47:46.525Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-27vq-hv74-7cqp","url":"https://github.com/advisories/GHSA-27vq-hv74-7cqp","licence":"CC-BY-4.0","modified":"2026-09-04T19:00:05.430Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-58356","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58356","licence":"Public domain","modified":"2026-10-27T18:10:00.130Z"}],"updatedAt":"2026-11-25T22:58:53.047Z","epss":{"score":0.00197,"percentile":0.09865,"date":"2026-12-01T12:00:22.000Z"}}