Proxy Mail QA

Check that one user can't see another user's data

In November 2026 a scan of Lovable apps found thousands whose Supabase database handed out rows to anyone with the key the page gives every browser. The fix is Row Level Security with a policy per user. The usual check, a curl with that key, only covers visitors who aren't signed in. This page covers both cases: no login, and signed in as someone else.

Updated

Figures below are from Crissy Field’s report on Lovable apps, as reported by Cybernews on 4 November 2026, and from UpGuard. Supabase details are from its documentation on 5 November 2026.

What happened

Crissy Field, a German security firm, took 159,041 Lovable apps from the Common Crawl web archive. Of the 34,545 that used Supabase, 24,664 returned database rows to a request with no login, using only the anon key each page hands the browser. In 7,403 of them those rows included email addresses, across more than 10,500 tables. One app returned over 1,000 passport records; a forum, more than 200,000 chat messages and 80,000 profiles; event and restaurant apps, orders with payment details and ticket codes.

Lovable called it an industry-wide problem with how Supabase gets set up, and it isn’t only Lovable: UpGuard separately found 16,326 Supabase databases with tables anyone could read. Apps from Bolt, v0, Replit, Cursor and Claude Code use the same setup, so the same checks apply.

Two ways the data gets out

A Supabase app’s browser talks to the database directly, with a key that’s in the page for anyone to copy. Row Level Security (RLS) decides which rows each request may see. It fails in two ways:

  • No login. RLS is off for a table, or the table was made without it. Anyone with the key can read every row, and often add, change or delete them too. This is what the scan found.
  • Signed in. RLS is on, but a policy lets any signed-in user through, for example using (true) for authenticated. Anyone who signs up, with any address, can read every other user’s rows. A request with no login gets nothing back, so the usual check passes.

Check 1: a request with no login

Open your app, find the Supabase project’s address and the anon or publishable key (in the page’s code or your project’s Project Settings → API Keys), and ask for one row from a table that holds anything about people:

Terminal
curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*&limit=1" \
  -H "apikey: YOUR_ANON_KEY" \
  -H "Authorization: Bearer YOUR_ANON_KEY"
  • A row comes back: anyone can read that table. Fix it before anything else.
  • [] comes back: RLS is on with no policy for visitors, or the table is empty. Add a row and try again.
  • An error saying permission denied: that table isn’t open to visitors at all.

Do it for every table in the public schema, and for views: a view runs as its owner and skips RLS unless it’s made with security_invoker. In the SQL editor, this lists the tables with RLS off:

sql
select c.relname as table_name
from pg_class c join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'public' and c.relkind = 'r' and not c.relrowsecurity;

Check 2: two real accounts

The signed-in leak only shows when one user asks for another user’s data, so you need two accounts that have both finished sign-up, email confirmation included. Proxy Mail QA gives you both:

  1. Create two addresses, each with a password, and sign up with each in your app. Open each confirmation link or code from its row.
  2. Signed in as account A, create something private: a note, an order, a profile detail. Copy its id from the address bar or the network tab.
  3. Signed in as account B, open A’s item by its link, list the table through the app, and try the curl above with B’s session token in place of the anon key in the Authorization header (copy it from the network tab).
  4. As B, try to change and delete A’s item, and to create an item with A’s user id.

Every one of those should fail. If B can see or change anything of A’s, a policy is too broad.

With a coding agent, connect the Proxy Mail QA MCP server and ask for the same check. The agent creates the two addresses, signs up and confirms both, has each create data, tries the reads and changes above, and records each attempt in a run, so the QA report shows which ones your app refused. Some agents, including Claude, will only sign up on an app running on your computer, so run it on localhost or have the agent write a Playwright test for staging.

Prompt
Using the Proxy Mail QA MCP server, start a run and create two addresses with passwords. Sign up with each on my app at http://localhost:3000 and confirm both. As the first account, create a private item. As the second, try to open it by its link, find it through the app, read it with the Supabase key and the second account's session, change it, delete it, and create an item with the first account's user id. Add a run note for each attempt saying whether the app refused it, then finish the run and give me the report.

Use both checks only on apps you own or are allowed to test, in development or staging.

The policies that fix it

Each table that holds a user’s data needs a column for its owner, RLS switched on, and one policy for each of select, insert, update and delete that compares that column with the signed-in user:

sql
alter table public.notes enable row level security;

create policy "Read own notes" on public.notes
  for select to authenticated using ((select auth.uid()) = user_id);

create policy "Add own notes" on public.notes
  for insert to authenticated with check ((select auth.uid()) = user_id);

create policy "Change own notes" on public.notes
  for update to authenticated
  using ((select auth.uid()) = user_id) with check ((select auth.uid()) = user_id);

create policy "Delete own notes" on public.notes
  for delete to authenticated using ((select auth.uid()) = user_id);
  • No policy for anon means visitors who aren’t signed in get nothing.
  • with check on insert and update stops a user writing a row with someone else’s id.
  • Shared data (a team’s projects, say) compares with a membership table instead, for example using (team_id in (select team_id from team_members where user_id = (select auth.uid()))).

To find policies that let every row through, run this in the SQL editor and look for true in either column:

sql
select tablename, policyname, cmd, roles, qual, with_check
from pg_policies where schemaname = 'public';

Files work the same way: check that Storage buckets holding users’ files aren’t public and have policies on storage.objects.

Copy-paste prompts for your builder

Prompt
List every table and view in the public schema, whether Row Level Security is on, and each policy with its roles and its using and with check expressions. Flag any table with RLS off, any view without security_invoker, and any policy that is true or doesn't compare the row's owner with auth.uid().
Prompt
For every table that holds a user's data, switch on Row Level Security and add select, insert, update and delete policies for authenticated users that only allow rows where user_id = auth.uid(). Give anon no access unless the table is meant to be public. Show me the SQL before running it.

Then run both checks again, with two new accounts. More on what generated apps get wrong at sign-in in vibe-coded login problems, and on testing every role in roles and permissions.

Try it on your next sign-up test

Free plan, no credit card. Create an address and watch the code or link arrive.

Create a free accountOpen the app

Questions

My app uses Supabase and the key is in the page. Is that the leak?

No. The anon (or publishable) key is meant to be public, like a site's address. What protects the data is Row Level Security and its policies. Without them, that public key can read the tables.

Row Level Security is on for every table. Am I done?

Not yet. A policy such as using (true) for authenticated users lets anyone who signs up read every row, and the anon-key curl won't show it. Check with two real accounts, as on this page.

Can I run these checks on someone else's app?

No. Run them only on apps you own or are allowed to test, in development or staging. Proxy Mail QA isn't a scanner for other people's sites.

What if a table really should be public, like a list of products?

Give it a select policy for anon and authenticated that says so, and no insert, update or delete policy for them. Keep anything about a person in a separate table with per-user policies.

Built your app with an AI tool? Pick yours

Lovable, Bolt, v0, Replit, Base44 and Supabase are products of their owners. Proxy Mail QA is independent and isn’t affiliated with or endorsed by them.