How to check if your Lovable or Supabase app is leaking user data
Updated
Your app is leaking data if a request with the public Supabase anon key, sent without signing in, returns rows from a table with user data. Row-level security (RLS) must be enabled on every table, and each policy must compare the row owner with auth.uid(), not just check that someone is signed in.
Why this happens
Apps built with Lovable, Bolt and similar tools talk to Supabase directly from the browser. The browser uses a public "anon" key, and Supabase expects you to protect data with row-level security rules in the database. If a table has no rules, or the rules are too broad, the public key is all anyone needs.
This is not a rare edge case. In 2025 a researcher scanned Lovable projects and found 303 exposed endpoints across 170 apps, tracked as CVE-2025-48757.
Step 1. Find your anon key and project URL
- Open your live app in Chrome and press F12.
- Go to the Network tab and reload the page.
- Filter by
supabase.co. Click any request. - In the request headers, copy the
apikeyvalue and the project URL, which looks likehttps://abcd1234.supabase.co.
The anon key is meant to be public. Finding it is not a problem by itself. What matters is what it can read.
No supabase.co requests in the list? Lovable projects created after May 13, 2026 run on TanStack Start and often load data on the server. The key is usually still in the browser for sign-in: open the Sources tab and search all files for supabase.co. If your project uses Lovable’s built-in backend (Cloud), it is Supabase underneath, so everything below applies the same way.
Step 2. Request a table without signing in
Replace the URL, key and table name, then run this in a terminal:
curl 'https://abcd1234.supabase.co/rest/v1/profiles?select=*&limit=5' \
-H "apikey: YOUR_ANON_KEY"
No terminal? Run the same request in the browser console on your app’s page (F12, Console tab):
fetch('https://abcd1234.supabase.co/rest/v1/profiles?select=*&limit=5', {
headers: { apikey: 'YOUR_ANON_KEY' }
}).then(r => r.json()).then(console.log)
Try every table that holds user data: profiles, users, orders, messages, subscriptions. Table names are usually visible in the same Network tab.
- An empty array
[]usually means RLS is on. Good, but keep going to step 3. - Rows with emails, names or payments mean anyone on the internet can read them. Fix this before anything else.
Step 3. Check the rules, not just the switch
The most common mistake is a policy that only checks whether a user is signed in:
-- lets ANY signed-in user read EVERY row
create policy "Users can view data" on profiles
for select using (auth.role() = 'authenticated');
Stuck at this point? That’s normal: this step is the most technical one. You can stop here and request the check, or keep going.
Sign up with a second test account and repeat the request with its access token in the Authorization: Bearer header. If you see the first account’s rows, the policy is wrong. A correct one compares the owner:
create policy "Users can view own profile" on profiles
for select using (auth.uid() = user_id);
Repeat this for insert, update and delete. A table where anyone can update any row is worse than one where anyone can read it.
What to check next
- Search your built JavaScript for
service_role,sk_liveandOPENAI_API_KEY. These must never reach the browser. - Check storage buckets: public buckets with user uploads are another common leak.
- Check edge functions and API routes: do they verify who is calling, or just trust the request?
Lovable’s built-in security scan is a useful first pass, but it mostly checks that rules exist. Whether they are correct for your data still needs a person to read them.