Skip to content
All rules

SB-RLS-OFF

Table in the public schema without Row Level Security

Severity
Critical
Confidence
High
Stack
Supabase
Runs
On by default

What the CLI looks for

A table in the public schema whose migrations never enable Row Level Security.

Why it matters

Tables in public are exposed through the Supabase Data API. Without RLS, the anon key that ships in your frontend can read and write every row.

How to fix it

Enable RLS on the table, then add an explicit policy for each operation the app needs. With RLS on and no policy, the table is closed by default.

alter table public.orders enable row level security;

create policy "Owners read their orders" on public.orders
  for select to authenticated
  using ((select auth.uid()) = user_id);