#50900·supabase

Postgres crashes on permission-denied for RPC functions (v17.6.1.111)

Author: deweetzCreated Sep 25, 2026Updated Sep 28, 2026
Labelsbugexternal-issuepostgres

Describe the bug

Calling a Postgres RPC function as the anonymous role, when that function has no EXECUTE grant for anon, crashes the Postgres process instead of returning a normal "permission denied" error. The database restarts (~10 seconds of downtime) every time this happens. Since the anonymous public API key is exposed in every browser by design, this means anyone can crash the database on demand just by calling any locked-down RPC function without being signed in.

To Reproduce Create any Postgres function in a Supabase project (even a trivial one-liner) Do not grant EXECUTE to the anon role Call that function via the REST API using only the public anon key (no auth session) Postgres crashes and the database restarts

Reproduced consistently on Postgres 17.6.1.111, both locally and confirmed on our production project.

Expected behavior

Calling a function without permission should return a normal "permission denied" error response, not crash the database process.

Screenshots

N/A

System information OS: macOS Postgres version: 17.6.1.111 Additional context

We worked around it by granting anon EXECUTE and checking caller identity inside each function instead of relying on Postgres to deny permission. This avoids the crash, but the underlying behavior seems like a platform-level bug that could affect any Supabase project with locked-down functions.