The mistake
Every table in the public schema is reachable through Supabase's auto-generated REST API with the anon key that ships in your frontend. A table created without enable row level security, or protected by a policy with using (true) / with check (true), is open to that key.
Why it is dangerous
Without RLS, anyone can read (and, depending on grants, insert, update or delete) all rows. A (true) policy for anon means anyone on the internet; for authenticated it means any user who can sign up. Write access with (true) is how apps get their data wiped or spammed. Views in public run with the view owner's permissions by default and return every row of an RLS-protected table, and the service_role key bypasses RLS completely.
How to fix it
Enable RLS on every public table, then add policies for what each role may do:
alter table notes enable row level security;
create policy "users read own rows" on notes
for select to authenticated using ((select auth.uid()) = user_id);Keep using (true) only for SELECT on data that is meant to be fully public. Keep the service_role key in server-only code, never behind a NEXT_PUBLIC_ / VITE_ prefix.
What this checker looks for
This page runs supa-launch-check, which reads
SQL migrations (supabase/migrations/*.sql), .env files and frontend code. The rules most relevant to this page:
| Rule | What it finds |
|---|---|
SLC101 | Table in public schema without Row Level Security |
SLC102 | Policy allows everything (using (true) / with check (true)) |
SLC103 | Storage bucket created as public |
SLC104 | SECURITY DEFINER function without a fixed search_path |
SLC105 | View in public schema bypasses RLS (no security_invoker) |
SLC001 | Supabase service_role key in code |
SLC006 | Client queries a table with no RLS evidence |
SLC007 | Service key exposed through a public env-var prefix |
Every finding has a rule id, a severity, file:line, the offending line (secrets masked),
why it matters and how to fix it. Run supa-launch-check rules for the full list.