The stranger test (1 minute)
Your app ships its public key (the "anon" or "publishable" key) in its JavaScript, so assume everyone has it. Ask your database for a private table with only that key, the way a stranger would:
curl "https://YOUR-PROJECT.supabase.co/rest/v1/messages?select=*" \
-H "apikey: YOUR_PUBLIC_KEY" -H "Authorization: Bearer YOUR_PUBLIC_KEY"Do it for every table that holds anything private (profiles, messages, orders, files). Pass: [] or an error.
Fail: real rows. You can also open your live site in a private window, open DevTools → Network, filter rest/v1,
and look at what comes back before you log in.
Supabase's Security Advisor (free, every project)
Dashboard → Advisors → Security Advisor, or from the CLI:
supabase db advisors # runs the same lints (supabase/splinter)It lists every exposed table with RLS turned off (rls_disabled_in_public, level ERROR) and flags sensitive columns
in them, like passport_number, password, iban or ssn (sensitive_columns_exposed). Pass: 0 errors.
The fixRLS on, plus an owner policy, on every table
-- 1. Nothing is readable through the API until a policy allows it
alter table messages enable row level security;
-- 2. Each signed-in user reads only their own rows
create policy "read own messages" on messages
for select to authenticated
using ((select auth.uid()) = recipient_id);
-- the same idea for writes
create policy "send as yourself" on messages
for insert to authenticated
with check ((select auth.uid()) = sender_id);For a profiles table, the owner column is usually id: using ((select auth.uid()) = id). Writing (select auth.uid())
instead of auth.uid() is Supabase's own performance advice (it runs once per query, not once per row). After the fix,
run test 1 again: the stranger should get [], and a signed-in user only their own rows.
The catcha policy that says true still leaks
create policy "anyone can read" on messages for select using (true); -- don't, on private dataWith this policy RLS is "on", so the Security Advisor shows 0 errors, but every stranger can read every row again.
(The advisor flags true policies for INSERT, UPDATE and DELETE, not for reads, because public read access is sometimes
intended.) AI app builders sometimes "fix" a broken page this way. So rerun the stranger test after every schema or
policy change.
Building with Lovable?
Lovable runs a security scan before every publish (built on Supabase's Security Advisor), and offers a deeper scan; its head of security says both are free for all users. You can also have it block publishing when there are critical findings: turn that on.
What I showed in the reel
A throwaway chat-app database on my Mac (PostgreSQL 17), laid out like a Supabase project (the anon and
authenticated roles, auth.uid(), Supabase's default grants), tables made in SQL with RLS off, and every row fake.
As anon: 6 of 6 private messages and 3 of 3 passport numbers. Security Advisor (splinter's SQL, unchanged): 3 errors.
After the fix: 0 rows for the stranger, 2 for the signed-in owner, 0 advisor errors. With an extra using (true) read
policy: 0 advisor errors and 6 of 6 messages readable again.
Sources: crissyfield.de/research/lovable-en (with Handelsblatt, Nov 2026); Lovable's head of security on Hacker News, 14 Nov 2026; Supabase docs "Hardening the Data API"; github.com/supabase/splinter. Not sponsored. Automated checks don't replace a professional security review for an app that holds real customers' data.