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

GHSA-H2C3-549C-GJPR

PATCH copy/move/test JSON Pointer operations bypass field-level SELECT permissions

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

Parche disponible
Descargar PNG JSON
CVSS 3.1
7.1
Alta
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N 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.
Sospechosa como un adjunto llamado factura_final2.exe.Huele a "ya lo veré". No la dejes así.
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-H2C3-549C-GJPR divulgada · CVSS 7.1 (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

A caller with table-level write permission on a record — `UPDATE`, and equally `CREATE`, `UPSERT`, `RELATE`, or `INSERT` — could read a field hidden from them by a field-level `PERMISSIONS FOR select` clause by moving it through a JSON Patch data clause.

The `SET`, `CONTENT`, `MERGE`, and `REPLACE` clauses compute their right-hand sides against a permission-reduced view of the record, so a restricted field reads as `NONE`. `PATCH` was the exception: its operations were applied to the full record loaded from storage, and the `copy`/`move` `from` pointer and the `test` `path` pointer were resolved against that full record. A previous fix (GHSA-fpxg-5xmv-922m, patched in 3.1.0) rejected only the empty root pointer; any pointer naming a field, a nested field, an element of an array, or an object that contained a restricted field still resolved against the unreduced record.

So a caller could copy a value they were not allowed to read into a destination field they chose, receive it in the statement result, and persist it where anyone who can select that destination can read it. `move` did the same and additionally removed the source field. `test` reported the value it found in its mismatch error, acting as a direct disclosure oracle without any durable write.

For example, given `DEFINE FIELD secret ON person PERMISSIONS FOR select NONE`, a record user with table-level update permission could run:

UPDATE person:1 PATCH [{ op: 'copy', from: '/secret', path: '/leak' }];
-- result: [{ id: person:1, leak: 'shh', ... }]

and read `secret` back under the name `leak`.

Impact

This affects any deployment that uses field-level `PERMISSIONS FOR select` to hide fields from principals who nonetheless hold table-level write permission — for example multi-tenant tables, user-profile tables, or partial-field redaction where record users can update rows.

What an attacker can do:

  • With table-level write permission (`UPDATE`, `CREATE`, `UPSERT`, `RELATE`, or `INSERT`) on a table, read the value of a field on that table denied to them by a field-level `PERMISSIONS FOR select` clause, by copying it into an unrestricted destination and reading it back, or by using `test` as a disclosure oracle.
  • Persist the copied value into a destination field, where it is then readable by anyone who can select that field.
  • With `move`, additionally remove the restricted source field as part of the same operation.
  • Reach a restricted field named directly, nested inside an object, inside an array element, or by naming an ancestor object or array that contains it.

What it can't do:

  • Reach records, tables, namespaces, or databases the caller cannot already access — this issue does not bypass table-level permissions, and the disclosure is confined to the field-permission layer within records the caller can already reach and write.
  • Escalate to namespace- or root-level privileges.
  • Bypass anything through the `add` or `change` operations, or through the `value::patch` function, which operates only on values the caller already supplies.
Patches

A `PATCH` `copy`/`move` `from` pointer, and a `test` `path` pointer, are now rejected when they read a field the caller may not select. Each pointer is judged by comparing what it resolves to on the record against what it resolves to on the permission-reduced view of that record; any difference — whether the pointer names the restricted field directly or an object or array that contains it — fails the statement rather than carrying the value out. The check is applied for every statement type with a `PATCH` clause and shares the pointer-resolution logic used to apply the patch, so a numeric token that reaches into an array is judged at the element the patch actually reads, and a shift from an earlier operation in the same patch cannot move a restricted field into range of a later pointer. The `add` and `change` operations are not gated, because each writes its result back to the path it read and so carries nothing out of the field.

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

Users unable to patch should consider the following workarounds:

  • Do not grant table-level write permission (`UPDATE`, `CREATE`, `UPSERT`, `RELATE`, or `INSERT`) to principals who must not read one of the table's SELECT-restricted fields. Restrict at the table level instead, or move sensitive fields to a table those principals cannot write.
  • Where less-trusted principals only need to write through controlled paths, route their writes through `DEFINE API` endpoints or functions, and deny them arbitrary queries with `--deny-arbitrary-query` (env `SURREAL_CAPS_DENY_ARBITRARY_QUERY`).
References
  • SurrealQL Documentation — UPDATE statement https://surrealdb.com/docs/surrealql/statements/update
  • SurrealQL Documentation — DEFINE FIELD https://surrealdb.com/docs/surrealql/statements/define/field
  • SurrealQL Documentation — DEFINE TABLE … PERMISSIONS https://surrealdb.com/docs/surrealql/statements/define/table
  • `fix(doc): reject PATCH read pointers into SELECT-restricted fields` (included in SurrealDB 3.3.0)
  • `fix(expr): resolve a JSON Patch array index as the element it names` (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:H
AltoBajoNinguno
IntegridadI:L
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< 3.3.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-h2c3-549c-gjpr

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