Pranav Innovates

You commented LOCK. Here’s everything from the reel.

Lock down your Supabase app: the 4 checks before it goes live

From @PranavInnovates (the "Comment LOCK" reel, Nov 2026). Researchers at Crissy Field and Handelsblatt looked at 159,041 apps built with Lovable. 24,664 sites sent Supabase database records the moment they loaded, with no login: one forum exposed more than 200,000 private chat messages, one service more than 1,000 passport records. Lovable's head of security named the root cause: insufficient Row-Level Security (RLS). Any Supabase app can have the same hole, however you built it. Here are the checks, with SQL you can paste.

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:

Terminal
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:

Terminal
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

sql
-- 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

sql
create policy "anyone can read" on messages for select using (true);   -- don't, on private data

With 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.