A Lovable app is safe to launch when six things hold: every table has row-level security with policies you have read, no secret key ships in the browser bundle, Supabase Auth has confirmation and leaked-password checks on, storage buckets are private with per-user policies, third-party keys live in Edge Functions, and a backup exists that you have restored once. Lovable’s built-in scan covers part of this. The rest takes about an hour with the Supabase dashboard open.
Six checks, in the order a senior architect runs them on a Lovable + Supabase app:
- RLS on every table, with policy bodies you have read, not just enabled
- No
service_roleorsb_secret_key anywhere the browser can see - Auth settings: email confirmation on, leaked-password protection on, real SMTP
- Storage buckets private, with upload and read policies scoped to
auth.uid() - Third-party keys in Lovable Secrets and Edge Functions, never in the client
- A backup you have restored, which means a paid Supabase plan before real users
Why the question is still open in 2026
On March 21, 2025, Matt Palmer reported to Lovable that generated apps were shipping without row-level security. The CVE, CVE-2025-48757, was published on May 29, 2025 after a 45-day window. The follow-up scan, summarized by Superblocks on September 3, 2025, found 170 of 1,645 Lovable apps (10.3%) with exposed databases across 303 endpoints: user names, emails, third-party API keys, transactions.
Lovable shipped a security scan on April 24, 2025 and, per its founder’s guide of March 24, 2026, now enables RLS by default and runs four scanners. Its own docs still say the tools “cannot guarantee complete security”. Red Access scanned 380,000 public assets on vibe-coding platforms in May 2026 and found 2,000+ holding sensitive corporate or personal data.
The mechanism has not changed. Your app’s browser code talks to Supabase directly with a public key, and RLS is the only thing between that key and every row.
The six checks
RLS with real policies
USING (true) on a SELECT is “enabled” and still public.No secret key in the client
service_role and sb_secret_. Secret keys bypass RLS entirely. Found one: rotate first, then move the code to an Edge Function.Auth settings
Bucket policies
Keys in Edge Functions
VITE_ or NEXT_PUBLIC_ variables is in the bundle.A restored backup
Check 1: RLS you have read, not RLS that is enabled
Lovable’s scanner and Supabase’s advisor both answer one question: is RLS switched on? The CVE was about tables where it was off. The 2026 failure is subtler: RLS is on, and the policy the AI wrote lets everyone through because that made the demo work.
Open Authentication, then Policies, and read every policy on every table that holds user data. A policy for a profiles table should mention auth.uid(); a policy that says true for SELECT on orders is the CVE with a green checkmark.
| Policy the AI wrote | What it means | What you want |
|---|---|---|
USING (true) on SELECT | anyone, signed in or not, reads all rows | USING (auth.uid() = user_id) |
TO authenticated USING (true) | any account reads every account’s data | same, plus the role restriction |
| no INSERT/UPDATE policy | writes fail, so the AI may have disabled RLS to “fix” it | explicit write policies, RLS stays on |
Check 2: the key that bypasses everything
Supabase has two families of keys. The publishable key (anon, or sb_publishable_ since 2025) is designed to sit in the browser and is constrained by RLS. The secret key (service_role, or sb_secret_) authenticates as a Postgres role with BYPASSRLS and “skips any and all Row Level Security policies”. Legacy anon/service_role JWT keys are deprecated by the end of 2026.
service_role string inside assets/index-*.js. Anyone who opens DevTools has full read and write on every table, and no policy applies.sb_publishable_.New sb_secret_ keys refuse browser requests with a 401, and Supabase auto-revokes secret keys found in public GitHub repos. Neither covers a legacy key or a private repo.
Checks 3 to 5: auth, buckets, and third-party keys
Auth. Two settings decide whether sign-up is a door or a hole. Confirm-email off means anyone registers with any address, including your CEO’s. Leaked-password protection uses the HaveIBeenPwned k-anonymity API and is available on the Pro plan and above; on the Free plan the check does not run. And the built-in mail service is limited to 2 emails per hour, so password resets stop the moment you have users.
Buckets. When a bucket is public, “anyone who possesses the asset URL can readily access the file”; uploads, deletes and moves still need a policy on storage.objects. The pattern that holds is a private bucket with one folder per user, guarded by (storage.foldername(name))[1] = auth.uid(), per the Storage access control docs. Uploaded IDs, invoices and avatars belong there, not in a public bucket with guessable names.
Third-party keys. Lovable now detects API keys pasted into the chat and steers them into Secrets. The earlier version of your app may predate that. Search the repo for sk_live_, sk-, re_ and any VITE_ variable holding a key, then move each call behind an Edge Function that verifies the user’s JWT. The Gmail-connected app checklist walks through the OAuth token case in detail.
Check 6: the backup nobody restored
The Supabase Free plan takes no automatic backups; the docs tell you to run supabase db dump yourself. Pro adds daily backups kept 7 days, Team 14, Enterprise 30. Point-in-time recovery, at $0.137 per hour (about $100 per month) for 7 days, archives the write-ahead log every two minutes for a worst-case loss of about two minutes. Storage objects are not included in any of them.
A backup you have never restored is a hope. Restore last night’s backup into a staging project, log in, and note the date. Reviewers in technical due diligence ask for exactly that date.
service_role. Those two actions close the CVE-2025-48757 class and the key-leak class, which is most of what Red Access found across 380,000 apps.When this stops being a checklist
Run the six checks yourself before the first paying customer. They become someone else’s job at the trigger moments: an enterprise pilot sends a security questionnaire, an investor starts due diligence, your first engineering hire asks how auth works, an incident happens, or the app slows down under real load. Each of those asks for evidence, not a green scan: the policies, the restore date, the map of which key does what. The five patterns common to most AI-built codebases still apply underneath.
If you would rather have senior eyes on the actual project first, that is what the free teardown is: three findings and a verdict, recorded, within 72 hours.
Sources
- Matt Palmer, CVE-2025-48757 disclosure, May 29, 2025 (reported March 21, 2025)
- Superblocks, Lovable vulnerability explained, September 3, 2025: 170 of 1,645 apps, 303 endpoints; scanner released April 24, 2025
- Lovable, A founder’s guide to Lovable security, March 24, 2026
- Lovable docs, Security, accessed August 31, 2026
- The Hacker News on Red Access, “The Shadow Builders”, May 29, 2026
- Supabase docs, Performance and Security Advisors, lint 0013, accessed August 31, 2026
- Supabase docs, Understanding API keys, accessed August 31, 2026
- Supabase, Security Retro: 2025, January 7, 2026
- Supabase docs, Password security and Password-based Auth, accessed August 31, 2026
- Supabase docs, Storage access control, accessed August 31, 2026
- Supabase docs, Database backups, accessed August 31, 2026