Can users see each other's data in my Supabase app?
- If a table has Row Level Security (RLS) off, or a policy like using (true), any signed-in user (sometimes anyone) can read every row.
- "Signed in" is not the same as "owner". The policy has to compare the row's owner with auth.uid().
- The only reliable test: two accounts. Create data with one, try to read it with the other.
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:
- RLS is turned off on a table (common for tables created later in the SQL editor or by a migration the AI wrote).
- A policy allows everything, for example using (true), often added to "make the error go away".
- A policy checks that the user is signed in (auth.role() = 'authenticated') but not that the row is theirs.
- The data is reached through a view or a database function that skips RLS (views run with the owner's rights unless they're created with security_invoker; functions marked security definer do too).
- Files are in a public storage bucket, so anyone with the link can download them.
How to check it yourself (10 minutes)
- Create two accounts in your app, A and B, in two different browsers (or one normal window and one private window).
- With A, create something private: an invoice, a note, a customer, an upload.
- With B, open every list and search in the app. A's data should never appear.
- 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.
- 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
- Lovable admin page accessible without login: hiding it isn't locking it
- Is the Supabase anon key safe to expose in my app?
- Can free users get your paid features? How to check your paywall
Updated 2026-11-24