llamaCVEVulnerability Intelligence
/
Advisory · GitHub · crates.io · surrealdb

GHSA-4W65-7H3J-P29H

REFERENCE ON DELETE CASCADE bypasses an edge table's PERMISSIONS FOR delete

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS 3.1
5.4
Media
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche a -4 d de la divulgación
Exposición54 dDesde la divulgación, 28 sept 2026, 6:15 a. m.
Detección53 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Bien priorizada, bien dormida.Hoy toca orden, no heroísmo.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 3.3.0
Monitoreo
Detectada +1
24 sept 26
28 sept 26
20 nov 26
21 nov 26
24 sept 26
9 oct 26
23 oct 26
7 nov 26
21 nov 26
FechaFaseEventoDetalle
Remediación Parche 3.3.0 surrealdb · -4 d desde divulgación
Divulgación Publicada GHSA-4W65-7H3J-P29H divulgada · CVSS 5.4 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

When a record is deleted, SurrealDB removes the graph edges connected to it. That edge removal is meant to run with the caller's permissions, so an edge table's `PERMISSIONS FOR delete` clause still applies — deleting an endpoint vertex must not let a caller erase edges they could not delete directly. A previous fix (GHSA-whwg-vh4f-pmmf, patched in 3.1.0) established this for a direct vertex delete.

A second route escaped that guarantee. A `DEFINE FIELD ... REFERENCE ON DELETE CASCADE` deletes the referencing record when the referenced record is deleted, and it computes that cascading delete with permissions disabled — which is deliberate, so referential integrity can complete regardless of what the caller may do to the referencing record. But permission enforcement was a single frame-wide flag, so the disabled state flowed on into the referencing record's own edge cleanup. If that referencing record was also a graph-edge endpoint, its edges were then removed without consulting the edge table's `PERMISSIONS FOR delete` clause.

The result was a cross-table authorization bypass: a caller with delete permission on one table could erase edge records in another table, whose `PERMISSIONS FOR delete` denied them, by deleting an endpoint reached through a `REFERENCE ON DELETE CASCADE`.

Impact

This affects deployments that combine `DEFINE FIELD ... REFERENCE ON DELETE CASCADE` with a referencing record that is also a graph-edge endpoint, where the edge table restricts deletion with a `PERMISSIONS FOR delete` clause.

What an attacker can do:

  • With permission only to delete an endpoint vertex, cause the deletion of protected edge records on an edge table whose `PERMISSIONS FOR delete` clause denies them, when the deletion is routed through a `REFERENCE ON DELETE CASCADE`.
  • Cause silent, unrecoverable loss of those edge records, which may carry business data.

What it can't do:

  • Read the contents of the deleted edges — this is an integrity issue, not disclosure.
  • Delete records on tables the caller cannot reach through such a cascade, or cross namespace or database isolation boundaries.
  • Escalate to namespace- or root-level privileges. System users (root, namespace, database owners) are governed by their role, not by this flag, and are unaffected.
Patches

The permission context is now split so the referential-integrity bypass no longer reaches the edge cascade. The reference `CASCADE` still disables permissions for the referencing record's own delete, but the record's edge cleanup runs under the caller's real permission state, so an edge table's `PERMISSIONS FOR delete` clause is evaluated exactly as it is for a direct `DELETE`. Edges the caller is not allowed to delete are left in place.

  • Versions 3.3.0 and later are not affected by this issue.
Workarounds

Users unable to patch should consider the following workarounds:

  • Restrict vertex `DELETE` permission on tables that are reference-cascade targets to principals trusted to delete all connected edge records.
  • Avoid `REFERENCE ON DELETE CASCADE` where the referencing record is also a graph-edge endpoint whose edge table relies on `PERMISSIONS FOR delete`.
  • Use namespace or database isolation as the primary boundary where edge-level `PERMISSIONS` is load-bearing.
References
  • SurrealQL Documentation — DEFINE FIELD https://surrealdb.com/docs/surrealql/statements/define/field
  • SurrealQL Documentation — Record references https://surrealdb.com/docs/surrealql/datamodel/references
  • SurrealQL Documentation — DEFINE TABLE … PERMISSIONS https://surrealdb.com/docs/surrealql/statements/define/table
  • SurrealQL Documentation — RELATE statement https://surrealdb.com/docs/surrealql/statements/relate
  • `fix(doc): keep the reference-CASCADE permission bypass out of the edge cascade` (included in SurrealDB 3.3.0)
Acknowledgements

Thank you to Yanhaoxi https://github.com/Yanhaoxi for reporting this issue.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:L
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
8.3/ 10Alto
Vector 8.3 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
surrealdb≥ 3.1.0 < 3.3.0
3.1.0
3.3.0
4.0.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.iosurrealdb
Corregida 3.3.0 -4 d 4.0.1 no afectada
Versiones corregidas3.3.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/surrealdb/surrealdb/security/advisories/GHSA-4w65-7h3j-p29h

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.