Skip to content

PreemotionSmall team, working globally.

For inquiriesdeban.work@outlook.com

  1. Blog
  2. AI-built apps

4 min readBy the Preemotion team

Is your Lovable app secure? 8 checks before you launch

Lovable's built-in scans catch a lot, but they don't know your business rules. These are the eight checks we run on every AI-built app before real users and real money touch it.

A padlock resting on a laptop keyboard under coloured light trails
Photo by FlyD on Unsplash

Lovable can turn a sentence into a working app in an afternoon. The question we get most is whether that app is safe to put in front of customers.

It can be. But "it works when I click through it" and "it holds up when a stranger pokes at it" are different tests, and only the first one happens while you're building.

Why this matters: the CVE that hit 170+ apps

In 2025, a vulnerability tracked as CVE-2025-48757 showed what goes wrong. An insufficient row level security policy in Lovable-generated apps, through April 2025, let unauthenticated attackers read or write arbitrary database tables. Researchers found over 170 apps exposed, because their database rules didn't actually restrict who could see the data. Lovable disputes the CVE on shared-responsibility grounds, which is the real lesson: the database rules are yours.

Lovable has since added a lot of protection. It now runs a security scan automatically every time you publish, checking your configuration, database schema and row level security, and offers a deeper AI review of your code that takes a few minutes. Use both. But Lovable's own security docs are clear that the scans don't replace a thorough security review, because a scanner can't know your business rules.

That's what these eight checks are for.

1. Every table has row level security, and real policies

Open your Supabase dashboard, go to the table editor and check that row level security is enabled on every table. Then read the policies. A policy like USING (true) is on, but it lets everyone in.

Each table should answer one question plainly: who may read this row, and who may change it? Customers see their own bookings. Staff see the day's bookings. Nobody anonymous sees anybody's email address.

2. Test it as a stranger, not as yourself

Your Supabase URL and anon key ship inside your app's code. That's by design: the anon key is public. So test what someone with only those two values can do.

Sign out, open the browser console and try to read each table through the Supabase client. Try to insert a row, update someone else's row and delete one. Everything that works there works for anyone on the internet.

3. The service role key is nowhere near the browser

The service role key skips row level security entirely. It belongs only in server code: Supabase edge functions or your own backend.

Search your code for it. In a Vite app, any environment variable starting with VITE_ is bundled into the browser, so the service role key must never have that prefix. If it has ever been in front-end code or a public repo, rotate it.

4. Business rules live on the server

This is the one scanners miss. In our own booking app, PawSlot, opening hours were only checked on the booking page. Anyone who skipped the page and called the database directly could book outside them, and unpaid bookings could hold every slot in the week.

The fix is to enforce the rules where the data lives: database constraints, policies or functions that reject a booking at 3 am no matter where the request comes from. Ask of every rule in your app: if someone skips the screen, does the rule still hold?

5. Payments are confirmed by Stripe, not by a redirect

If your app marks an order paid when the customer lands on a "thank you" page, anyone can visit that page without paying. Payments should only be marked paid when Stripe tells your server, through a webhook whose signature you verify.

In PawSlot, a deposit only confirms a booking when the signed webhook arrives. Until then the slot is a hold that expires.

6. Storage buckets aren't accidentally public

Supabase storage has its own policies. Check every bucket: is it public, and should it be? Uploaded invoices, ID documents and private photos should sit in private buckets, served through signed URLs that expire.

7. Edge functions check who's calling

Every edge function that does something sensitive should verify the user's token and check their role before acting. A function that sends emails, issues refunds or changes roles, callable by anyone with the URL, is an open door.

8. Sign-up and sign-in settings are deliberate

Check the boring settings: email confirmation on, password reset links pointing at your real domain, allowed redirect URLs limited to your own sites, and sensible rate limits on sign-up. Decide who can become an admin, and make sure it isn't "whoever edits their own profile row".

Then run the scans again

After fixing what you find, run Lovable's deep scan and the Supabase security advisor again, and write a few tests for the rules that matter most. On PawSlot we ended with 29 database security tests that run against the real policies, so a future change can't quietly undo them.

Most AI-built apps don't need a rebuild to be safe. They need an afternoon of someone asking awkward questions about who can do what. If you'd rather we asked them, we take AI-built apps to production.

Questions

Is Lovable secure?

The platform itself is maintained by Lovable, and it now scans apps for common problems every time you publish. Whether your app is secure depends on its database rules, its keys and its business logic, which you own. Run the checks in this post before launch.

Is the Supabase anon key safe to expose?

Yes, it is designed to be public. It only identifies your project. What protects your data is row level security: with the right policies, the anon key can only do what an anonymous visitor should be allowed to do.

Does Lovable's security scan replace a security review?

No. Lovable's own documentation says its scans support secure development but don't replace a thorough security review. The scans don't know rules that are specific to your business, like who may book which slot.

AI apps to production: we can do this for youBuilt it in Lovable, Bolt or Replit? We move it to your own stack and add the payments, logins and security it needs to launch.

See the service