Why Lovable apps leak data
Your app's Supabase URL and publishable (anon) key are in its front-end code. That is by design: the key only identifies your project. What stops a stranger from reading your tables is Row Level Security (RLS), the database rules that decide which rows each user may see. Supabase's own docs put it this way: the publishable key is safe to expose with RLS enabled.
Things go wrong in three common ways:
- RLS is off on a table. Tables created through SQL or migrations, which is how AI builders usually create them, start with RLS off in PostgreSQL unless someone turns it on.
- RLS is on, but a policy allows everything. A policy like
using (true)for theanonrole passes the "RLS enabled" box and still lets anyone read every row. - A secret key is in the browser. The
service_roleor secret key bypasses RLS completely. It must never ship in front-end code.
How big the problem is
In November 2026 the Hamburg security firm Crissy Field, working with the German newspaper Handelsblatt, looked at 159,041 Lovable projects. 34,545 used Supabase. 24,664 of those returned database records on page load without a login (some harmlessly, such as public menus). On 7,403 sites, tables holding email addresses could be read with simple read-only requests. Exposed data included passport numbers, chat messages, orders with addresses and payment details, contracts and invoices. (Coverage and figures.)
The 10-minute self-check
Only test apps you own or have permission to test.
- Run the Security Advisor. In your Supabase dashboard, open Advisors, then Security Advisor. Fix every table flagged with RLS disabled in the public schema. In Lovable, also run the security scan, including the deep scan, which does not run on its own.
- Read your policies. For every table with personal data (profiles, orders, messages, files), check who each policy lets in. Look for
using (true), policies foranonon private tables, and select policies that don't compare the row's owner toauth.uid(). - Test as a stranger. Find your project URL and publishable key in your app (browser dev tools, Network tab, requests to
supabase.co, headerapikey). Then, logged out, run:
Repeat for each table. If a private table returns rows, anyone on the internet can read it.curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*&limit=3" \ -H "apikey: YOUR_PUBLISHABLE_KEY" - Test as another user. Sign up with a second account and try to open the first account's data: change an ID in a URL, or query a table while logged in as user B. Users should only ever see their own rows.
- Check storage. Buckets marked public serve every file to anyone with the link. Uploaded IDs, invoices and contracts belong in private buckets with policies.
- Search the bundle for secrets. Open your deployed JavaScript and search for
service_role,sk_liveand other API keys. Anything secret in there must move to an edge function or server, and the key must be rotated.
How to fix an open table
Turn RLS on, then add a policy that matches who should see each row. For a table where each user owns their rows:
alter table public.profiles enable row level security;
create policy "Users read their own profile"
on public.profiles for select
to authenticated
using ((select auth.uid()) = id);
Turning RLS on with no policies blocks all access through the API, so parts of your app may stop loading until you add the right policies. That is expected. Add insert, update and delete policies the same way, and test again as a stranger and as a second user.
If your check found something
- Fix the open tables first, then rotate any secret key that was ever in the browser.
- Check your Supabase logs for reads you don't recognise.
- If personal data was exposed, check what your local data-protection law requires you to report.
Not sure what you're looking at? Send us the link. The free app rescue verdict includes this data-exposure check, plus auth, payments and what breaks first at scale.
Common questions
Is it safe that my Supabase key is visible in the browser?
The publishable (anon) key is meant to be public, and it is safe when every exposed table has RLS on with correct policies. The service role or secret key is never safe in the browser, because it bypasses RLS.
Does Lovable's security scan catch this?
It catches a lot, including tables with RLS turned off. A scan can't know which rows each of your users should see, so also test as a logged-out visitor and as a second user.
I turned on RLS and my app stopped working. What now?
That is normal. With RLS on and no policies, the API returns nothing. Add a policy for each thing users need to do, such as reading their own rows, then test again.
Does this apply to Bolt, Cursor, Replit and v0 apps?
Yes. Any app that queries Supabase from the browser depends on RLS, whichever tool wrote the code.
What does the free verdict include?
A written keep, fix or rebuild verdict within 24 hours, with checks on data exposure, auth and payments, and a fixed price for each fix. There is no obligation to hire us.