For the complete documentation index, see llms.txt. This page is also available as Markdown.

v2.5.2

pREST v2.5.2 fixes three advisories (stored-query RCE, unauthenticated catalog, plugin path traversal) and replaces pg.single with pg.allowed_databases.

Released: October 18, 2026

GitHub tag Β· Compare v2.5.1...v2.5.2

v2.5.2 is a security release. It fixes three advisories published against v2.5.1 and earlier (#1070). It also reworks how pREST picks which databases to serve when no registry is configured (#1068): pg.single is removed and pg.allowed_databases replaces it. MySQL README and sample config wording (#1062) and dependency bumps (#1067, #1071) ship in the same tag.

  • Docker: prest/prest:v2.5.2 (linux/amd64 and linux/arm64)

  • Go install: go install github.com/prest/prest/v2/cmd/prestd@v2.5.2


Security

Stored queries can no longer be written over REST (GHSA-2x9q-r7j9-g85f)

Critical, CVSS 9.0. Reported by arkmarta.

With database-backed queries (queries.storage = "database"), script bodies live in the prest_queries table. Before v2.5.2 nothing stopped the generic table routes from writing that table. With the default [access] restrict = false, one POST /{db}/public/prest_queries stored arbitrary SQL, and a second request to /_QUERIES/{location}/{name} ran it. When pREST connects as a PostgreSQL superuser (as the sample compose files do), that SQL can run OS commands through COPY ... FROM PROGRAM. The same routes could also read prest_users.

v2.5.2 adds a reserved table list. These names are matched case-insensitively, in any schema:

  • prest_queries

  • prest_users

  • the configured queries.table

  • the configured auth.table (PREST_AUTH_TABLE)

They are blocked on every data route, regardless of restrict, ignore_table, per-user rules, or whether auth and database-backed queries are enabled:

Request
Response

Any method on /{db}/{schema}/{reserved}, /batch/..., /show/...

401 {"error":"authorization required"}, even with an admin token

_join that targets a reserved table

400 {"error":"table is reserved for pREST internal use"}

MCP select_table / describe_table on a reserved table

JSON-RPC permission error

Manage stored queries through the /_QUERIES/registry API (admin-only). Manage users with SQL or prestd migrate. See Permissions β€” Reserved tables.

Catalog routes require auth (GHSA-fhf5-m388-4w4p)

High, CVSS 7.5. Reported by Hama1cco.

The catalog routes were registered outside every middleware stack. With auth.enabled = true, a caller with no token got 200 from /databases, /schemas, /tables, /{database}/{schema}, and /show/{database}/{schema}/{table}, while CRUD on the same tables correctly returned 401. On PostgreSQL, /databases read pg_database, so it listed every database on the server, including ones pREST was not configured to serve.

From v2.5.2 these routes run through authentication and table access control:

  • With auth.enabled = true: no token is 401 {"error":"authorization token is empty"}.

  • /show follows [access]: with restrict = true, a table not granted read is 401, as it is on CRUD. This applies with auth off too.

  • /databases lists only served databases: registry aliases, or pg.database plus pg.allowed_databases (#1068).

Only /auth, /_health, /_ready, and /_studio stay public. To re-expose a route on purpose, add it to [jwt] whitelist. See Auth β€” Routes that require auth.

Plugin names are confined to pluginpath (GHSA-fmr6-9j48-xrqp)

High, CVSS 8.1. Reported by T4ran24.

/_PLUGIN/{file}/{func} joined {file} onto pluginpath without a containment check, so a traversal such as ../../tmp/x loaded any .so file on disk. The route also had no authentication of its own.

From v2.5.2:

  • {file} must be letters, digits, _, or -, 1–63 characters, with no dots.

  • {func} must be a Go identifier.

  • The resolved path must stay inside pluginpath, after symlinks are resolved. A symlinked .so that points outside is rejected.

  • An invalid name is 400 {"error": "invalid plugin name"}. The rejected name is not echoed. A missing library is still 404.

  • With auth.enabled = true, /_PLUGIN requires a token. With auth off the route stays open; only the path checks apply.

  • The same name rules apply to [[pluginmiddlewarelist]] file / func values.

See Endpoint Plugin β€” Name rules and auth.


Multi-database (#1068)

Co-authored by @samithiwat. Most of the initial changes came from the brickstechnology/prest fork.

pg.single removed

pg.single and PREST_PG_SINGLE are ignored. Startup logs:

What changes:

  • A registry is no longer limited to pg.database. Before, a registry with pg.single = true (the default) accepted only the default alias. Now a registry serves all of its aliases.

  • Without a registry, only listed databases are served. Before, pg.single = false let any database on the [pg] host be reached by putting its name in the path. Now only pg.database plus pg.allowed_databases are served. Any other name is 400 database not registered: <name>.

  • /databases and MCP prest.list_databases list only served databases.

  • On MySQL without a registry, {schema} must equal {database}. On MySQL a schema is a database, so this stops one served name from reading another database the login can see. /{db}/{other}/... is 404 schema not served by this database.

pg.allowed_databases

Extra databases on the [pg] host, using the [pg] credentials, served when no [[databases]] registry is configured. Works on PostgreSQL and MySQL.

See Multi-database β€” No-registry mode.

Unreachable registry entries

In v2.5.1 any [[databases]] entry that failed to connect at startup stopped the server. From v2.5.2:

  • A network or DNS failure registers the alias lazily. It answers 503 {"error":"database unavailable"} and reconnects on first use. The response does not include driver text such as host and port.

  • Startup still fails on invalid config or auth errors, or when every entry is unreachable.

  • The default adapter is the first reachable alias.

  • /_ready pings every alias, so it returns 503 while any one is down.

  • Timescale detection and startup migrate_on_startup steps skip a lazy alias until the next restart.

Smaller changes

  • PostgreSQL keeps at most 64 distinct pools per process. A request that would open another gets 503.

  • Entries from DATABASE_ALIAS_N / DATABASE_URL_N inherit the global maxopenconn / maxidleconn. Before, 0 meant unlimited.

  • /databases returns aliases sorted.

  • A connection or DNS failure is 503 database unavailable on CRUD, /_QUERIES/registry, and MCP.

  • /auth returns a generic 401 {"error":"authentication failed"} when the user lookup hits a SQL or driver error. user not found is unchanged.

  • MySQL /schemas in registry mode lists only the registry entries on the same host and port, not every database the login can see (#1070).

  • prestd version on a go install build reports the module version (for example v2.5.2) instead of a hard-coded 2.0.0. Builds with no version info report devel.

  • The Kubernetes manifest image is prest/prest:v2 (was v1).


Dependencies

  • golang.org/x/crypto 0.57.0 β†’ 0.58.0 (#1067).

  • pREST Studio dependency updates (#1058–#1061, #1069), applied in #1071. The embedded /_studio bundle is rebuilt; no Studio behavior change.


Changes since v2.5.1

PR
Summary

Security hardening: reserved tables, catalog and /show auth/ACL, /_PLUGIN confinement and auth

Multi-database fixups: pg.single removed, pg.allowed_databases, lazy 503 aliases, scoped /databases (co-authored by @samithiwat, from brickstechnology/prest)

README and sample config for MySQL

golang.org/x/crypto 0.58.0

Studio dependency updates

Full detail: compare v2.5.1...v2.5.2. Commit list: Changes since v2.5.1.


Upgrading from v2.5.1

  1. Retag to prest/prest:v2.5.2 or go install github.com/prest/prest/v2/cmd/prestd@v2.5.2.

  2. Check for reserved table names. If an application table is named prest_users or prest_queries, or matches your auth.table / queries.table, rename it. REST, _join, and MCP can no longer reach it.

  3. Audit stored queries. If you ran queries.storage = "database" on v2.5.1 or earlier without auth, look for rows you did not create, and delete them:

    Use your queries.schema / queries.table if you changed them. Do not trust created_by: a REST write could set it to any value. Read the SQL columns themselves.

  4. Use a least-privilege database role. Connect as a role without superuser, pg_read_server_files, or pg_execute_server_program. A non-superuser role cannot run COPY ... FROM PROGRAM, which limits what any stored-SQL bug can do.

  5. Give catalog clients a token. With auth.enabled = true, anything that calls /databases, /schemas, /tables, /{database}/{schema}, /show/..., or /_PLUGIN without a token now gets 401. Send a bearer token, or whitelist the route on purpose.

  6. Check plugin names. Rename .so files whose basename contains a dot, and replace symlinks that resolve outside pluginpath.

  7. Replace pg.single. Use a [[databases]] registry, or list extra databases in pg.allowed_databases. Requests for any other database now get 400.

  8. MySQL without a registry: paths where {schema} differs from {database} now get 404.

  9. If you skipped v2.4.2, check your jwt.key length. A short HMAC key does not stop startup; it disables /auth. See v2.4.2 β€” Upgrading.


Last updated