Blog
Built Your App With Lovable and Supabase? Check Your Row Level Security Before Someone Else Does
Researchers say thousands of Lovable apps handed out customer data to anyone who asked. The fix is not to stop using AI builders. It's a one-hour checklist, straight from Supabase's own docs.
Caleb Dorris 10 November 2026, 10:00 AM 10 min

The short version
The public key is supposed to be public. Row Level Security is what keeps your data private.
Researchers at Crissy Field say they could read records with email addresses in 7,403 of 24,664 Lovable sites that loaded Supabase data without a login. Their own caveat: that's not a confirmed leak rate. Either way, the fix is the same: turn on RLS for every table, revoke the grants you don't use, write per-user policies, keep the secret key on the server, and test your app logged out.
I like Lovable. I've told people it's a great way to get a real app in front of customers without hiring someone like me first. So this isn't an "AI coding is dangerous" post. It's a "here's the part the AI won't make you do, so do it yourself" post. I've written before about how I use vibe coding as a senior developer, and this is the step I always do by hand.
What happened
On November 2, Handelsblatt published a story by Lina Knees on research by Crissy Field, a Hamburg application security firm. Crissy Field has its own write-up online, with what it calls "a more recent analysis and updated figures compared with the Handelsblatt article." Here's what Crissy Field's report says:
- It found 159,041 Lovable projects in the Common Crawl web archive from December 2025 to September 2026. 34,545 of them used Supabase as their database.
- 24,664 of those sites sent Supabase records as soon as the page loaded, with no login. Crissy Field is clear that this alone isn't a problem, since some data is meant to be public.
- With further read-only requests using the same API key the site already ships, it found records with email addresses in 10,560 tables across 7,403 of those 24,664 sites. That's 30% of the 24,664, not 30% of all Lovable apps.
- Examples it lists: more than 80,000 forum profiles plus more than 200,000 chat messages, tens of thousands of ticket and food sales records including payment information, more than 1,000 records with passport details, contracts, invoices, WhatsApp messages, and in one case 280,000 emails sent to a provider's customers.
Read the numbers carefully
What the researchers say their numbers don't mean
Crissy Field says the 30% "should therefore not be read as a confirmed data leak rate," that its sample "is also not representative of all Lovable applications," and that it "could not establish whether any of it had been misused." It also didn't look at Lovable's own newer built-in database, only Supabase. And it's a security consultancy that sells reviews, which it says at the end of the report. None of that makes the examples less real, but it's how I'd read the numbers.
The report doesn't use the words "Row Level Security." It talks about data reachable "with the same API key" and about access permissions. But in Supabase, the thing that decides what that public key can read is Row Level Security, so that's where I'd look first. Supabase's own API keys page says the publishable key is meant to be public: "Anyone can read it, so it only reaches what Row Level Security allows."
What Lovable says
I couldn't read Lovable's reply to Handelsblatt myself because the article is paywalled. India Today reports that Lovable "reportedly told Handelsblatt that the problem was not limited to its platform and was widespread across the industry." That's secondhand, so take it as such.
What Lovable says in its own docs is pretty direct. Its security page says: "Misconfigured RLS rules are a common cause of data leaks." And: "You are responsible for ensuring that your app meets the security requirements appropriate for its use case." Its Terms say the same thing in legal form: "You are responsible for your Customer Data and for the applications and projects you build, deploy, and make available using the Services."
Honestly, that's fair. Supabase is built so that the database is safe to talk to straight from the browser, but only if the rules are right. The AI writes the rules about as well as you describe what should be private. If you never said "customers should only see their own orders," it may not have written that rule.
The checklist
Everything below comes from Supabase's and Lovable's own docs. If you built the app with Lovable, you can do most of it from inside Lovable. If you're comfortable in the Supabase dashboard, it's faster there.
1. Run the scanners you already have
- Lovable Quick scan. Per Lovable's docs it runs automatically every time you publish and checks for "tables without per-record access control (row-level security), access rules that let everyone through, and leaked-password protection turned off," plus your npm dependencies and any MCP server you expose without auth. Don't just publish past the warnings. Open the Security view and read them.
- Lovable Deep scan. Run it by hand before you put real customer data in. Lovable says it reviews all your code for access control, unauthenticated endpoints, exposed data, secrets, auth and payments issues. Scheduled deep scans are Enterprise only, so on other plans, set yourself a reminder.
- Supabase Security Advisor. In the Supabase dashboard, or
supabase db advisorsfrom the CLI. The findings I'd fix first: RLS disabled on a public table, RLS enabled but no policies, a policy that exists while RLS is off, a "security definer" view, policies that reference user metadata, overly permissive policies, sensitive columns exposed, and a public storage bucket that allows listing. Supabase's advisors page lists them all.
Worth knowing
The scans are a floor, not a ceiling
Lovable's own docs say its scans "do not replace a thorough security review." Same with Supabase's advisors. They catch the common mistakes. They don't know which of your tables is supposed to be private.
2. Test it logged out, like a stranger would
This is the test I do on every Supabase app I touch, and it's the one the researchers basically did. Open your live site in a private window, don't log in, and look at the network tab in your browser's developer tools. Every request to your-project.supabase.co/rest/v1/... is your database answering a stranger. If you see customer names, emails, orders or messages in those responses, that table is public right now.
Only do this against your own project. If you want to poke at one table directly, use your own publishable key:
# Your own project only. Logged out: this should return [] or an error, not customer rows.
curl "https://YOUR-PROJECT.supabase.co/rest/v1/customers?select=*&limit=1" \
-H "apikey: YOUR_PUBLISHABLE_KEY"3. Turn RLS on for every table in an exposed schema
Supabase's RLS guide is blunt: "A table in an exposed schema without RLS is readable and writable by any role with a grant on it. Enable RLS on every table in an exposed schema." That usually means everything in public.
alter table public.customers enable row level security;Turning it on with no policies locks the table for the public key. That's the safe default. If something in the app breaks, it's because that page needed a policy, which is step 5.
4. Revoke the grants you don't need
This is the one most people miss. Supabase's docs: "On projects that still grant anon and authenticated by default, revoke those grants. Adding policies doesn't remove them." Then grant back only what the app uses. For a table only signed-in users should touch:
revoke all on table public.customers from anon, authenticated;
grant select, insert, update on table public.customers to authenticated;5. Write one policy per action, scoped to the user
Supabase's pattern for "people only see their own rows":
create policy "customers_select_own" on public.customers
for select to authenticated
using ((select auth.uid()) = user_id);A few rules from Supabase's docs that trip people up:
- Write separate policies for select, insert, update and delete. An update needs a matching select policy to work.
to authenticatedkeeps logged-out visitors out before the rest of the rule even runs.- A policy with
using (true)for anon means every row is public. Supabase says to use it "only for data that is meant to be public." If your AI tool wrote one of those, check that the table really is public. - Add an index on the column the policy checks, like
user_id, or big tables get slow.
6. Don't trust user-editable metadata
Supabase warns that raw_user_meta_data "can be updated by the authenticated user" and "is not a good place to store authorization data." If a policy checks something like role = 'admin' from user metadata, any user can make themselves an admin. Keep roles in raw_app_meta_data or your own table.
7. Fix views
"Views bypass RLS by default," per Supabase, because Postgres creates them as security definer. On Postgres 15 and up:
create view public.order_summary
with (security_invoker = true)
as select ...;On older versions, revoke access to the view from anon and authenticated, or move it to a schema the API doesn't expose.
8. Keep the secret key on the server
The publishable key (sb_publishable_...) is fine in the browser. The secret key (sb_secret_..., or the older service_role key) "bypasses Row Level Security, so it must never leave your control," per Supabase. If it's in your frontend code, your repo, or a Lovable prompt, rotate it. I wrote up how to rotate API keys after a leak. Supabase also says it's retiring the old anon and service_role keys by the end of 2026, so this is a good week to move to the new ones anyway.
9. Check storage buckets
Same idea for files. A public bucket that allows listing lets anyone see every file name in it. The Security Advisor flags this. Contracts, IDs and invoices don't belong in a public bucket.
10. Write a test so it stays fixed
Supabase supports pgTAP tests: supabase test new customers_rls to create one and supabase test db to run them. One test that says "a logged-out user gets zero rows from customers" will catch the day a future AI edit quietly opens it back up. Then re-run the scans after every big change. Crissy Field says the same: re-check "after significant changes."
If you think your data was exposed
Lock it first (steps 3 and 4), then figure out what was reachable and for how long. Supabase's logs can help. If personal data like emails, payment details or ID numbers was exposed, you may have notification duties depending on where you and your customers are. Talk to a lawyer before you assume you don't. And rotate any keys that were sitting in those tables.
The bottom line
Lovable and Supabase didn't do anything weird here. The public key is supposed to be public. The rules behind it are your job, and Lovable's docs say so. Turn RLS on everywhere, revoke the grants you don't use, write per-user policies, keep the secret key off the frontend, and test it logged out. If you'd rather have someone else do it, that's literally what I do.
FAQ
Is Lovable unsafe to use?
No more than any tool that lets you ship a database-backed app fast. Crissy Field itself says access control mistakes "can happen in any application, whether written by people or built with AI." The difference is that AI builders make it easy to ship before anyone checks.
Is the Supabase publishable key a secret?
No. Supabase says it's safe to put in a web page. What protects your data is RLS. The secret key is the one to guard.
Does Lovable's scan catch this?
Its Quick scan checks for tables without RLS and access rules that let everyone through, per its docs. It can't know which data you meant to be private, so still do the logged-out test.
Sources
- Crissy Field, "Lovable: Many Apps Built on the Platform Expose Sensitive Data"
- Handelsblatt, "Lovable: Experten finden Datenlücke bei beliebter KI-Coding-Plattform" (in German, paywalled)
- India Today, "AI app-maker Lovable apps expose personal details, researchers find thousands of cases"
- Lovable docs, Security
- Lovable, Terms
- Supabase docs, Row Level Security
- Supabase docs, API keys
- Supabase docs, Advisors
- Supabase docs, Production checklist
Need a web developer in Nashville?
PHP, WordPress and Next.js. Free quote, and I usually reply within a couple of hours.
caleb@calebdorris.com and call or text (615) 914-1073