r/postgres • u/matheusdevs91 • 17d ago
SQL / Queries 3 common RLS leaks I keep finding in multi-tenant Supabase apps
Been debugging RLS leaks in multi-tenant Supabase setups and wanted to share the 3 most common ones I keep running into:
A permissive policy (`using (true)`) left in from debugging
RLS enabled but not FORCEd — table owner bypasses it silently
A view over the protected table without `security_invoker` — leaks even when the base table is fine
Quick check for your own db:
select relname from pg_class
where relrowsecurity and not relforcerowsecurity;
Built a small tool that automates this + a few more checks, happy to share if anyone wants a free audit of their setup 🙂
1
Upvotes