Menu

Five Supabase RLS Mistakes a Read-Only Query Can Catch
📰

Five Supabase RLS Mistakes a Read-Only Query Can Catch

DEV Community: postgres·Trung Thanh Tran·6 days ago
#9vJ1VXsI
#devtopostgresql#devto#dev#select#enter
Reading 0:00
15s threshold

Supabase gives every app a public anon key, and that key can talk to your database through the REST API. Row Level Security is the only thing standing between that key and your tables. When an app gets built fast, sometimes with an AI coding tool writing the migrations, RLS is often on but written in a way that still lets one user read another user's rows. CVE-2025-48757 was exactly this class of bug, across a large number of generated apps.

Most of these mistakes are visible in Postgres's own catalog. You can find them with a SELECT , without touching a single row of user data. Here are five, with the query that spots each one and the fix.

1. RLS is simply off

select n . nspname as schema , c . relname as table_name from pg_class c join pg_namespace n on n . oid = c . relnamespace where n . nspname = 'public' and c . relkind in ( 'r' , 'p' ) and not c .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.