Menu

Is my Supabase database exposed? 4 tests you can run in 10 minutes (RLS checker)
📰

Is my Supabase database exposed? 4 tests you can run in 10 minutes (RLS checker)

DEV Community: postgres·ProofForge·3 days ago
#xrprIJsX
#devtopostgresql#devto#dev#test#supabase
Long article (308 words) — no AI summary yet.
Reading 0:00
15s threshold

Row Level Security (RLS) is what decides who can read your Supabase tables. If it is off, or a policy is too broad, anyone with your public anon key can read the data through the API. Here are four tests you can run on a project you own.

Test 1: Is RLS enabled?

In the Supabase dashboard, open Table Editor . Tables without RLS show an "RLS disabled" warning. Or run in the SQL editor:

select schemaname , tablename , rowsecurity from pg_tables where schemaname = 'public' ;

Enter fullscreen mode

Exit fullscreen mode

Every table with user data should have rowsecurity = true .

Test 2: Do any policies allow everything?

select tablename , policyname , cmd , qual from pg_policies where schemaname = 'public' ;

Enter fullscreen mode

Exit fullscreen mode

A qual of true on a private table means any role the policy covers can read every row.

Test 3: Anonymous read

Request a table with only the anon key, signed out:

curl -s "https://YOUR-PROJECT.supabase.co/rest/v1/YOUR_TABLE?select=id&limit=1" \ -H "apikey:…

Continue reading — create a free account

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