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

GHSA-FHF5-M388-4W4P

pREST's catalog endpoints (/databases, /tables, /show) bypass the authentication stack entirely - with authentication enabled, unauthenticated requests enumerate every database, schema, table, and column on the PostgreSQL server

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
7.5
Alta
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición33 dDesde la divulgación, 18 oct 2026, 7:09 p. m.
Detección31 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, automatizable e impacto técnico parcial. No hay versión corregida: aplique mitigaciones.
Ojo con los rangos de versión, son traicioneros.Revisa si tu versión cae en el rango. Te espero.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
19 oct 26
19 nov 26
21 nov 26
19 oct 26
27 oct 26
4 nov 26
13 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-FHF5-M388-4W4P divulgada · CVSS 7.5 (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

All evidence, reproduction steps, and scripts in the report were verified against a real running instance. Nothing is fabricated or synthetic; every verdict is backed by captured output from an actual deployment.

pREST (Go middleware that exposes a PostgreSQL database as a REST API) protects its CRUD and query routes with a JWT authentication middleware, but its catalog endpoints - the metadata routes that list and describe database structure - are registered with plain `HandleFunc` calls outside that middleware stack (src/router/router.go:41-43 and :66-67, versus the CRUD routes at :71-75 which pass through the full crudStack including `AuthMiddleware`). With `PREST_AUTH_ENABLED=true` and a valid JWT configuration, a request with no token at all retrieves: every database on the PostgreSQL server, including databases belonging to other tenants (`GET /databases` queries `pg_database`); the full table/owner listing across schemas (`GET /tables`); and complete column names, types, and defaults for any table (`GET /show/{database}/{schema}/{table}`). Verified on a live v2.4.2 instance with authentication enabled: the CRUD route correctly answers 401 to the same unauthenticated caller while the catalog routes answer 200 with the full structure map. An attacker gets a precise server-wide map of databases, schemas, tables, columns, and defaults with zero credentials - the reconnaissance that makes targeted SQLi, cross-tenant probing, or data theft efficient. The root cause is structural: catalog controllers were simply never included in the authentication stack, and `cfg.AuthEnabled` gates only the CRUD/query/MCP/auth route groups.

Details

The route registration split:

# src/router/router.go:41-43, 66-67
#   HandleFunc("/databases", ...)   - plain registration, no middleware stack
#   HandleFunc("/tables", ...)      - plain registration, no middleware stack
#   HandleFunc("/show/{database}/{schema}/{table}", ...)  - same
# src/router/router.go:71-75 (contrast)
#   crudRoute(crudStack, ...) - includes AuthMiddleware
# src/app/app.go:116-119
#   global stack attaches only AdapterSelectorMiddleware - no global auth

`PREST_AUTH_ENABLED=true` gates the CRUD, query, MCP, and auth route groups; the catalog controllers check nothing themselves. The exposure therefore persists in every deployment that relies on pREST's own authentication, and the leaked map spans the whole PostgreSQL server rather than the configured database - `pg_database` is a server-level catalog, so co-located tenant databases are enumerated even when pREST is scoped to one. We verified the parallel SQLi class (CVE-2025-58450, no fixed release) is mitigated on v2.4.2 by `validatePathSegments`/`ident.IsSafeSegment`, and the write-side unconditional DELETE/PUT behavior is reported separately; this report covers only the catalog authentication gap.

Proof of concept

The instance is pREST v2.4.2 (source-built, Go) in front of PostgreSQL 16, `PREST_AUTH_ENABLED=true` with an HS256 JWT configuration, database `pr6cr4db` plus a second database `pr6cr4_other` simulating a co-located tenant. No token is sent in any request:

#!/usr/bin/env bash
BASE=http://127.0.0.1:21990

# step 1: list every database on the server (server-level pg_database catalog)
curl -s "$BASE/databases"

# step 2: full table/owner listing, and column detail for a table
curl -s "$BASE/tables"
curl -s "$BASE/show/pr6cr4db/pr6cr4_api/t1"

# step 3 (control): the CRUD route correctly rejects the same caller
curl -s -i "$BASE/pr6cr4db/pr6cr4_api/t1" | head -1

Captured output from the running instance (verbatim from the retained probe log):

$ curl -s http://127.0.0.1:21990/databases
[{"datname": "postgres"}, {"datname": "pr6cr4_other"}, {"datname": "pr6cr4db"}]  # cross-tenant DB list, HTTP 200
$ curl -s http://127.0.0.1:21990/tables   # 200, full table/owner/schema listing
$ curl -s http://127.0.0.1:21990/show/pr6cr4db/pr6cr4_api/t1  # 200, columns/types/defaults
$ curl -s http://127.0.0.1:21990/pr6cr4db/pr6cr4_api  # 200
contrast: $ curl -i /pr6cr4db/pr6cr4_api/t1 -> 401 {"error":"authorization token is empty"}

Output interpretation: the same unauthenticated caller receives 401 from the CRUD route and 200 with the database inventory from `/databases` - authentication exists and works, the catalog routes simply sit outside it. The listing includes `pr6cr4_other`, a database this pREST deployment is not configured to serve, demonstrating the server-wide (cross-tenant) reach. Paths and database names are instance-specific; the stable verdict is the unauthenticated catalog access under `PREST_AUTH_ENABLED=true`.

Impact

Unauthenticated enumeration of the full PostgreSQL server structure (CWE-306/CWE-200): every database (including co-located tenant databases), every schema, table, column, type, and default value, with zero credentials, in any deployment using pREST's built-in authentication. This is a map for follow-on attacks - cross-tenant probing in shared PostgreSQL deployments, precise targeting of injection or access-control flaws, and exposure of schema-level trade secrets. A fix is to route the catalog endpoints through the same authenticated stack as the CRUD routes, and to scope `/databases` to the configured database rather than the server-level catalog.

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:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
10.0/ 10Muy alto
Vector 10.0 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
github.com/prest/prest≤ 2.5.1
v1.5.5
2.5.1
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-fhf5-m388-4w4p

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