Can users see each other's data in my Supabase app?

Why this happens so often in AI-built apps

When you ask Lovable, Bolt or Cursor for "a page where users see their invoices", the screen usually filters by the current user. It looks right. But the filter lives in the page, not in the database. The database still answers whatever the browser asks for, and anyone can open the browser's network tab and ask for more.

In Supabase, the database is protected by Row Level Security (RLS): rules that decide which rows each request can see. The leak appears when one of these is true:

How to check it yourself (10 minutes)

  1. Create two accounts in your app, A and B, in two different browsers (or one normal window and one private window).
  2. With A, create something private: an invoice, a note, a customer, an upload.
  3. With B, open every list and search in the app. A's data should never appear.
  4. With A, open the item and copy its address (for example /invoices/123). Paste it in B's browser. B should get an error or an empty page, not A's data.
  5. In the browser's developer tools (Network tab), look at the requests B makes to supabase.co. If you change an id or remove a filter and the response still has A's rows, the database is not protecting them.

You can also list which tables have RLS on, and their policies, in the Supabase SQL editor:

-- rowsecurity = false means RLS is off: policies don't apply and the table answers any request
select tablename, rowsecurity from pg_tables where schemaname = 'public';

-- Every policy, with who it applies to and its condition
select tablename, policyname, roles, cmd, qual from pg_policies where schemaname = 'public';

Look for tables with rowsecurity = false, and for qual values like true or auth.role() = 'authenticated' on tables that hold per-user data.

Prompt to fix it

Fix prompt

Audit every table in the public schema that stores data belonging to a user or a team. For each one: enable Row Level Security; make sure it has an owner column (user_id or team_id) set from auth.uid() on insert; and replace any policy that uses true or only checks that the user is signed in with policies for select, insert, update and delete that only allow rows where user_id = auth.uid() (or where the user is a member of the row's team). Check views (use security_invoker) and functions marked security definer so they don't skip these rules. Don't change the UI. List every table and policy you changed.

After the fix, repeat the two-account test. The AI can say it fixed it; only the test proves it.

Want us to run this test for you?

The US$9 crash test without code signs in as two test users on your live app and checks this for you: data between users, private pages and the API behind them, free vs. paid plans, and what your public Supabase key opens. You get the evidence and a fix prompt for each issue.

Related guides

Updated 2026-11-24