If you built an app with Lovable, Bolt, Cursor or any other AI builder on top of Supabase, there is a real chance anyone on the internet can read your database right now. No hacking needed, just the public key that your app already sends to every visitor’s browser.
In early November 2026, German security firm Crissy Field scanned 159,041 Lovable projects and found 24,664 that returned database records without any login. Exposed data included passport records, 200,000 private chat messages, payment details, contracts and email addresses. A month earlier, UpGuard found 16,326 Supabase databases with readable tables across the web.
This guide shows you how to check your own app in about 15 minutes, how to fix it with Row Level Security (RLS), how to use Lovable’s built-in security scan, and what to do if your users’ data was exposed.
- The problem: tables without RLS, or with RLS rules that allow everyone, can be read by anyone holding your app’s public Supabase key.
- Not a Lovable breach: researchers blame missing or weak RLS rules in each app, which Lovable calls an industry-wide configuration problem.
- Quick check: run Lovable’s Security view > “Run deep scan”, then run the SQL checks below in Supabase.
- Fix: enable RLS on every table, revoke default grants from
anonandauthenticated, add one policy per operation, and test. - Never put the
service_roleor secret key in front-end code. - If data leaked: fix first, rotate keys, check logs, tell affected users and check your legal duty to report.
What Happened With Lovable Apps
| Finding | Number |
|---|---|
| Lovable projects scanned (from Common Crawl web archive data) | 159,041 |
| Projects running on Supabase | 34,545 |
| Supabase projects returning records with no login | 24,664 |
| Sites with readable email addresses | 7,403 (over 10,500 tables) |
| Chat messages exposed by one forum app | 200,000+ (plus 80,000 profiles) |
| Passport records exposed by one service | 1,000+ |
Other exposed data included order and ticket records with phone numbers and addresses, payment information, AI summaries of internal emails, tens of thousands of contracts and invoices, personal photo albums and internal WhatsApp messages. The researchers used only read-only requests with the same key every browser receives.
UpGuard’s separate study (October 14, 2026) looked at about 300,000 domains using Supabase and found 16,326 databases with readable tables. More than half showed signs of personal data, and some held passwords or login tokens.
How the Leak Works (Plain English)
A Supabase app has two kinds of keys:
- Public key (called
anonon older projects, or a publishable key on newer ones). It is meant to be in your front-end code. Anyone can see it in the browser. - Secret key (
service_roleor a secret key). It bypasses all security and must stay on a server.
The public key is safe only if your database has rules saying who can see which rows. Those rules are called Row Level Security (RLS). Supabase’s own docs warn that a table in an exposed schema without RLS is readable and writable by any role with a grant on it.
The trap: Supabase turns RLS on by default for tables made in its Table Editor, but not for tables created through SQL or the API, which is how AI coding agents usually build them. And even with RLS on, a policy like using (true) for the anon role lets every visitor read every row.
Is Your App at Risk?
You should check if any of these are true:
- Your app uses Supabase (Lovable Cloud, Bolt, v0 and many Cursor or Claude Code projects do).
- An AI agent created your tables, not you in the Table Editor.
- You stored users, messages, orders, bookings, documents or uploads.
- You never wrote or read your RLS policies yourself.
- You added tables after launch and did not re-run a security scan.
Step 1: Run Lovable’s Security Scan
Lovable has two built-in scans, and both are free to run.
| Scan | What it checks | When it runs |
|---|---|---|
| Quick scan | Tables without RLS, rules that allow everyone, leaked-password protection off, npm dependency audit, MCP servers with no auth | Automatically on publish |
| Deep scan | Everything in Quick scan, plus your code: access control, unauthenticated endpoints, injection, leaked secrets, payments, auth, exposed personal data | Not automatic while you work. Run it yourself |
- Open your project in Lovable.
- Open the Security view.
- Click “Run deep scan”.
- Fix every Critical finding first, then Warnings. “Try to fix” is free for your first 10 fixes per account, and each free fix comes back 24 hours after use.
- Turn on “Block publishing with critical issues” under workspace Privacy & security.
- Turn on leaked-password protection if you use email and password sign-in.
Lovable itself says these tools cannot guarantee complete security, so do the manual checks too.
Step 2: Check Your Tables in Supabase
Open your Supabase dashboard, go to the SQL Editor, and run these read-only queries.
Find tables with RLS turned off:
select tablename, rowsecurity
from pg_tables
where schemaname = 'public'
order by rowsecurity, tablename;
Any row with rowsecurity = false is open. Fix those first.
Find policies that allow everyone:
select tablename, policyname, roles, cmd, qual
from pg_policies
where schemaname = 'public'
and (qual = 'true' or roles::text like '%anon%');
A policy with qual = true for anon means every signed-out visitor sees every row. That is fine for a public blog posts table, and a disaster for users or messages.
Check views: views bypass RLS by default because they run as the postgres user. List them with select viewname from pg_views where schemaname = 'public'; and make sure none expose private tables.
Step 3: Test Your App Like an Outsider
Only test apps you own. Open your live app, press F12, go to the Network tab, and find a request to your-project.supabase.co/rest/v1/. Copy the project URL and the apikey header value (the public key).
Then, from a terminal, ask for one row from a sensitive table without signing in:
curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*&limit=1" \
-H "apikey: YOUR_PUBLIC_KEY"
On older projects using a legacy anon key, also add -H "Authorization: Bearer YOUR_PUBLIC_KEY".
- Empty list
[]or a permission error: good, signed-out visitors cannot read it. - Real user data: that table is exposed. Go to Step 4 now.
Repeat for every table that holds personal data: users, profiles, messages, orders, bookings, payments, documents.
Step 4: Fix It With Row Level Security
This follows Supabase’s official procedure. Replace messages and user_id with your table and owner column.
- Turn on RLS. Once on, the public key reads nothing until you add policies.
alter table public.messages enable row level security; - Remove default grants. Adding policies alone does not take these away.
revoke all on table public.messages from anon, authenticated; - Grant back only what signed-in users need.
grant select, insert, update, delete on table public.messages to authenticated; - Add one policy per operation so each user only touches their own rows.
create policy "Users read own messages" on public.messages for select to authenticated using ( (select auth.uid()) = user_id ); create policy "Users insert own messages" on public.messages for insert to authenticated with check ( (select auth.uid()) = user_id ); create policy "Users update own messages" on public.messages for update to authenticated using ( (select auth.uid()) = user_id ) with check ( (select auth.uid()) = user_id ); create policy "Users delete own messages" on public.messages for delete to authenticated using ( (select auth.uid()) = user_id ); - Re-run the curl test from Step 3. It should now return nothing.
- Test the app signed in to make sure users still see their own data.
- Optional, recommended: write tests with
supabase test new messages_rlsand runsupabase test db, as Supabase suggests.
For truly public data (like published blog posts), keep RLS on and add a read-only policy: for select to anon, authenticated using (true), with no insert, update or delete grants for anon.
Prompts to Ask Lovable to Fix It
If you prefer to let the AI do it, be specific:
- “Enable Row Level Security on every table in the public schema. Revoke all grants from anon. Add separate select, insert, update and delete policies so users can only access rows where user_id equals auth.uid().”
- “List every RLS policy that uses true or applies to the anon role, and explain whether each table should be public.”
- “Check the code for any use of the service_role or secret Supabase key in front-end files and move it to an edge function.”
- “Review my app’s security” (Lovable’s conversational review, uses credits).
Then verify with the SQL and curl checks above. Never trust “done” without testing.
Other Holes to Close
| Area | Risk | Fix |
|---|---|---|
| Storage buckets | Public buckets expose uploaded IDs, photos and PDFs | Make private buckets for user files and add storage policies |
| Secret key in front end | Full database access for anyone | Move to edge functions or server code, then rotate the key |
| Edge functions | Endpoints callable without login | Check the user’s JWT inside the function |
| Views | Bypass RLS by default | Use security_invoker views or remove them from the public schema |
| Third-party API keys | Keys pasted into code get scraped | Store in Lovable Secrets; rotate any key that was in code |
| Sign-ups | Bots create accounts and read “authenticated” data | Scope policies to the owner, not just “any signed-in user” |
The same pattern hit other AI app builders. See our check for exposed Grok Build apps, and what to do after the Notion AI Fireworks key leak.
If Your Data Was Already Exposed
- Close the hole first with Step 4.
- Rotate keys: the secret key if it was ever in front-end code, plus any third-party API keys stored in tables.
- Check logs in Supabase (API and Postgres logs) for unusual bulk reads.
- Reset passwords or tokens if login tokens or password hashes were readable.
- Tell affected users plainly: what was exposed, when, and what to watch for (phishing using their details).
- Check your legal duty. In the EU and UK, a personal data breach usually must be reported to the regulator within 72 hours if it risks people’s rights. India’s DPDP rules and many US states also have notice rules. Talk to a lawyer if you handled IDs, health or payment data.
Troubleshooting After Enabling RLS
| Symptom | Cause | Fix |
|---|---|---|
| App shows no data after enabling RLS | No select policy yet | Add a select policy for the right role |
| Error 42501 “permission denied” | Missing grant (checked before policies) | Grant the operation to authenticated, then check policies |
| Insert fails with “new row violates row-level security policy” | Insert policy with check fails |
Make sure the app sets user_id to the signed-in user |
| Admin page broke | Admin used public key and open rules | Use an edge function with the secret key, or a role-based policy |
| Queries got slow | Policy column not indexed | Add an index on user_id; wrap auth.uid() in select as shown |
Pre-Launch Security Checklist
- RLS on for every public table, confirmed with the SQL query.
- No
using (true)policies on private data. - Default grants revoked from
anon. - Curl test returns nothing for every private table.
- No secret key in front-end code.
- Private storage buckets for user uploads.
- Lovable deep scan clean, and “block publishing with critical issues” on.
- Leaked-password protection on.
- Re-check after every new table or auth change.
My Take
AI builders make shipping fast, but they do not make you safe by default.
The fix here is not hard: about 20 lines of SQL per table and a 15-minute test. If you use agents like Claude Code or Cursor to build apps, add “enable RLS and write per-operation policies for every table” to your project instructions.
Our guide on how to create an AI agent covers setting standing rules like this.
FAQ
Was Lovable hacked?
No. Researchers said the exposure came from missing or weak RLS rules in individual apps, not a breach of Lovable’s platform. Lovable called it a known, industry-wide Supabase configuration problem.
Is the Supabase anon key a secret?
No. It is meant to be public. It is only safe when RLS is enabled and your policies restrict access. The service_role or secret key is the one that must never be public.
Does enabling RLS break my app?
It blocks all access until you add policies, so add select, insert, update and delete policies right after enabling it, then test signed in.
Does this affect Bolt, v0 or Cursor apps?
Yes, any app using Supabase with a public key can have the same problem. UpGuard found 16,326 exposed databases across many builders.
Is Lovable’s security scan enough?
It is a strong start and free to run, but Lovable says it cannot guarantee complete security. Always confirm with the SQL check and an outsider test.
How do I know if someone already read my data?
Check Supabase API logs for large or unusual reads from unknown IPs. If logs are short, assume exposure if the table was open and follow the steps in the “already exposed” section.
Can I ask Lovable to fix RLS for me?
Yes, use the prompts above or “Try to fix” in the Security view. Always re-test afterwards.
Sources
- Cybernews: Apps built on Lovable expose passport details and 200,000 chat messages
- Runtime Wire: Lovable-built apps exposed passport numbers (November 3, 2026)
- UpGuard: Systemic data exposure in Supabase apps (October 14, 2026)
- Supabase docs: Row Level Security
- Lovable docs: Security
- TechCrunch: Some Supabase customers are exposing people’s data (September 25, 2026)




