VibeFix

Guide · Lovable

Users can see other users' data in my Lovable app (Supabase fix)

Published by Yosef D., founder of VibeFix

How this guide was made: Written with AI assistance and checked against the sources linked on this page.

Updated

Short answer: If users can see other users' data, the standard fix, as Supabase's docs describe it, is to turn on row-level security for every table your app reads through the API and add policies so each signed-in person can read only their own rows. Hiding rows on screen is not enough; the rule has to live in the database.

Get it fixed: a free check first confirms the problem on your live app, usually in 4 to 10 minutes.

Free. No account needed. It usually takes 4 to 10 minutes.

Want it fixed? For Lovable apps or code on GitHub, our AI agent fixes it in your code for $79 and tests your live app again. If we can't complete your re-check, you get your money back.

In our checks of 44 live AI-built apps, 5 (11%) let anyone read data that should be private, without signing in.

What we add from real checks: the owner almost never sees it. It shows up only for a second account, or a signed-out visit to a shared link, on the live address.

Why can users see other users' data in my Lovable app?

Because the database enforces who can read what through row-level security, and if that protection is missing or too loose, the app is the only thing standing between visitors and everyone's data. Your app's public key is in every visitor's browser.

What can let one user see another user's data?

The causes on this page are row-level security off on a table, a rule that lets every row through, filtering on screen instead of in the database, a public storage bucket, and a secret or service_role key in front-end code.

How do I stop users seeing other users' data?

Turn on row-level security for each table that holds personal rows and add policies so each signed-in person can read only their own rows.

  1. In the Supabase dashboard, open Advisors, Security Advisor. Fix every "RLS disabled in public" error (Supabase calls it "Table publicly accessible") and look at every "permissive RLS policy" warning, which flags rules such as using (true). (Supabase: Database Advisors)
  2. Turn row-level security on for each table that holds personal rows: alter table public.your_table enable row level security;
  3. List every table that still has row-level security off: select tablename from pg_tables where schemaname = 'public' and rowsecurity = false;
  4. Replace any policy that lets every signed-in user read every row, such as to authenticated using (true). Use the owner rule in step 7 for private rows.
  5. Views bypass row-level security by default. On Postgres 15 and later, run alter view public.your_view set (security_invoker = true); for each view in the public schema, so it follows the rules of the tables it reads.
  6. Add a read policy so people see only their own rows: create policy "Users can view their own rows" on public.your_table for select to authenticated using ( (select auth.uid()) = user_id );
  7. Add matching insert, update and delete policies, or saves will start failing. See data won't save: row-level security.
  8. For uploaded files, make the bucket private and add policies on storage.objects, following Supabase Storage: Access control.
  9. Remove any secret or service_role key from front-end code. Supabase says to never use a secret key in the browser, because service_role bypasses row-level security. If one was exposed, replace it with a new key.

How do I check it's fixed?

  1. On the live address, sign up two brand-new accounts and create a record in each. Each account sees only its own.
  2. Signed out, in a private window, open a link to one of those records. It shows nothing private.
  3. The Security Advisor shows no "RLS disabled in public" error.

What is the main catch when I turn on row-level security?

Turning row-level security on without policies locks everyone out: Supabase says that once it is enabled, no data is reachable through the API with the publishable key until you create policies. Add the read and write policies in the same change, then test with a new account, not yours.

Why do I never notice that users can see each other's data?

Because you only ever look at your own account, and seeing someone else's data takes a second account or a signed-out visit to a shared link, which you rarely try. You're signed in, your customers aren't. Lovable's docs say its scans do not replace a thorough security review.

Frequently asked questions

Is my Supabase public key a secret?

No. The publishable (anon) key is meant to be in the browser. What keeps data private is row-level security on every table, which is why a table without it is open.

How do I find which tables are open?

Open Advisors, Security Advisor in the Supabase dashboard. It flags tables in the public schema without row-level security, and policies that let every row through.

Does Lovable's security scan catch this?

It can flag open tables and loose rules, but Lovable's docs say its scans do not replace a thorough security review. Test with a second account and a signed-out visit as well.

I turned row-level security on and now my app shows nothing. Why?

A table with security on and no policies returns no rows. Add a select policy for the owner of each row, and insert and update policies for saving.

Can VibeFix fix it for me?

Yes, for apps built in Lovable or any app whose code is on GitHub. The free check confirms the problem on your live app first. If you want it fixed, our AI agent finds the cause, fixes it in your code for $79 and tests your live app again. See pricing.

Sources (official documentation)

Related: Supabase RLS policy generator · Fix 42501 tool · Data won't save: "new row violates row-level security policy" · Is a secret key or admin page visible on my live app? · My builder says the app is tested, but my customers hit problems

VibeFix is independent. Lovable, Bolt, Replit, Base44, v0, Supabase, Firebase, Stripe and Vercel are trademarks of their owners.

Fixed it? Prove it works on your live app

A fix that works from your own account proves nothing about a new customer. Your AI fixed it. VibeFix proves it works on the live site.

How it works. Start with a free check: our AI agent tries your live app like a new user and shows you what breaks. Then, on request, it reviews your code independently, because VibeFix isn't part of any app builder. It fixes it in your code and re-checks your live app. The free check signs up once as "VibeFix Test" with its own inbox, needs no account, never changes your app and never emails your users.

More guides · Shopify store accessibility · About · Your privacy choices