Menu

Supabase says your table is publicly accessible (RLS disabled): what to do, in order
📰

Supabase says your table is publicly accessible (RLS disabled): what to do, in order

DEV Community: postgres·ProofForge·3 days ago
#oJlhQNgL
#devtopostgresql#devto#dev#table#policy
Long article (381 words) — no AI summary yet.
Reading 0:00
15s threshold

Supabase warns you when a table in the public schema has Row Level Security (RLS) turned off. You may see it as a Security Advisor warning in the dashboard (the lint is called rls_disabled_in_public ) or as an email about a publicly accessible table. If you got one, treat it as real. Here is what to do, in order.

What the warning means

With RLS off, any request that carries your project's anon key can read, and often write, that table through the API. The anon key is in your app's JavaScript, so anyone can get it. The table is open to the internet.

Step 1: Turn RLS on

In the SQL editor:

alter table public . your_table enable row level security ;

Enter fullscreen mode

Exit fullscreen mode

With RLS on and no policies, nobody except the service role can access the table. Your app will stop reading it until you add policies. That is the safe default.

Step 2: Add the narrowest policy that works

For data that belongs to a user:

create policy "owner can read" on public .…

Continue reading — create a free account

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