Lovable security: is Lovable safe, and what your app still needs

Lovable is a sound platform to build on, but whether your app leaks depends on your project: the row level security (RLS) policies on its database, the keys that reach the browser, and whether your edge functions and server code check who is calling. Lovable's Quick scan and Deep scan catch many of these mistakes by reading your code and settings. Neither one attacks the live app.

The team behind Keybrum's attacksUpdated 16 min read

In short

  • Lovable runs the hosting, the builder, the database server and the scanners. Your app's access rules, secrets and code logic are yours: its own docs say you are responsible for meeting the security needs of your use case.
  • Lovable apps read their database from the browser with a public key, so RLS on each table is the main lock. In CVE-2025-48757, 170 of 1,645 Lovable apps scanned had missing or weak RLS, about one in ten.
  • The Quick scan runs on every publish and checks database rules, critical dependency flaws and exposed MCP servers, but not your code. The Deep scan reads the code and runs only when you start it.
  • Both built-in scans are static analysis. To know what a stranger gets, test the published app from outside, signed out and with a second account.
  • Apps created since May 13, 2026 run on TanStack Start with server code. Server code that uses an admin key skips RLS and must check ownership itself.
On this page

Is Lovable safe? The short answer

Yes for the platform, with conditions for your app. Lovable writes the code, hosts the app and runs the database for you, and it holds SOC 2 Type II, ISO 27001:2022 and AIUC-1 certifications. It is not HIPAA compliant and does not sign the business associate agreements HIPAA requires. What it cannot decide for you is who may read which rows, which values belong on a server, and what each function should refuse. Its security documentation says so plainly: you are responsible for making sure your app meets the security requirements of its use case, especially when it handles sensitive data.

Most public Lovable security issues are of that second kind. The best known, CVE-2025-48757, came from a scan of 1,645 Lovable apps in which 170 had missing or weak RLS. The platform itself has had one widely reported problem too, covered below. So the honest answer has two parts: what Lovable runs, and what you ship.

What Lovable is responsible for, and what you are

AreaLovable handlesYou handle
Hosting and the builderServers, deploys, accounts, the project visibility settingWho is in your workspace, and keeping projects private
DatabaseA managed PostgreSQL database, daily backups, the database password (rotated when you ask)The RLS policies that decide which rows each user can read or change
SecretsEncrypted storage, injected into edge functions, never sent to the browserPutting secret keys in Secrets, never in frontend code or VITE_ variables
Generated codeWriting it, and changing what you ask forChecking that each function and server route refuses the callers it should refuse
Security scansQuick scan on every publish, Deep scan on demand, optional Wiz and Aikido connectorsRunning the Deep scan, reading the findings, fixing them
Based on Lovable's security, built-in backend and secrets documentation, November 2026.
Ultimately, it is at the discretion of the user to implement these recommendations.
Igor Andriushchenko, Lovable CISO, to The Register in February 2026, about the free security scan before publishing

The stack Lovable builds, and where it leaks

Lovable apps created from May 13, 2026 (June 22, 2026 for Enterprise workspaces) use TanStack Start, which renders pages on the server. Older apps use React with Vite and render in the browser. There is no choice of framework. The data lives in PostgreSQL, either in Lovable's built-in backend, which its docs describe as built on Supabase's open-source foundation and enabled by default, or in a Supabase project you connect yourself. The built-in backend adds sign-in, file storage, realtime updates and edge functions: small server programs that run your AI features, emails and payments.

The browser talks to the database directly. The project URL and the public key sit in .env as VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY, are built into the JavaScript bundle and, per Lovable's docs, are safe to be public. Like the Supabase anon key it replaces, the publishable key gives every visitor the anon role. Your database policies are what stand between a stranger and your rows.

LayerWhat Lovable generatesWhere it leaks
Browser bundleA Supabase client with the URL and publishable key, and calls that name your tablesA secret key pasted into a VITE_ variable or a component reaches every visitor's browser
DatabaseTables and policies, written as SQL migrationsA table without RLS, a policy whose condition is true, or a policy for signed-in users that never compares the row's owner to auth.uid()
Database functionsRPC functions for admin checks, counters, searchA function marked security definer that anyone can call, or an access check written backwards
Edge functionsAI chat, emails, Stripe payments and webhooksNo check on the caller: strangers spend your AI credits or send email in your name; webhooks accepted without a signature check
Server code (TanStack Start apps)Server rendering and server logicCode that uses an admin client skips RLS, so it must check ownership itself
StorageBuckets for avatars and uploadsA public bucket holding private files, or policies that let any user read every folder
Sign-upSign-up and sign-in pagesOpen sign-up plus policies that only check that the caller is signed in: any stranger gets in after creating an account

What Lovable's security scan catches, and what it does not

Lovable ships a real set of security tools, and it deserves credit for them. Here is what its documentation describes as of November 2026.

ToolWhen it runsWhat it checks
Quick scanAutomatically when you publish (it starts when the publish dialog opens), and on demandDatabase rules (tables without RLS, rules that let everyone through, leaked-password protection turned off, storage rules), known vulnerabilities in npm dependencies (only critical ones become findings), and MCP servers exposed without authentication. It does not read your application code.
Deep scanOnly when you start it, from the Security view, the workspace Security center or the chat. Scheduled runs are Enterprise onlyEverything in the Quick scan, plus your code: access control (including server code that bypasses database rules), unauthenticated endpoints, injection, leaked secrets, payments, authentication, exposed personal data
Security review in chatWhen you ask for oneAn AI review of your code (XSS, input handling, sign-in flaws) and your RLS policies. It also starts a free Deep scan; the chat itself uses credits
Secret detectionWhen you paste a key into the chatGuides you to store the key in Secrets instead of in code, and offers a connector when it recognises the service
Aikido pentest (optional)On a project, once the workspace connects AikidoDynamic tests: AI agents send real payloads to your running app. Billed by Aikido
Block publishing with critical issuesWorkspace settingStops publishing while critical findings are open. On by default in new Enterprise workspaces
Source: Lovable security overview. Running either scan is free. Try to fix all draws on 10 free fixes per account, each available again 24 hours after use; past that, fixes use credits.

Two limits matter. First, Lovable states that its built-in scanners are static analysis: they read code and configuration and flag patterns that look risky. They do not send requests to your live app to see what comes back. Second, a scan only reports. In the February 2026 case below, Lovable said a scan had been offered before publishing and its recommendations were not applied. Its own docs add that these tools cannot guarantee complete security, and suggest a professional review for apps with sensitive data.

Lovable security issues: three public cases

CVE-2025-48757: missing RLS in 170 apps

In March 2025, researchers scanned the home pages of 1,645 apps listed on Lovable Launched, Lovable's showcase, and found 303 endpoints across 170 projects, about 10.3%, with inadequate RLS. Their write-up lists names, phone numbers, subscriptions, payment details and API keys among the exposed data, and notes that pages behind a login were not checked. NVD lists the CVE with a CVSS score of 9.3, assigned by MITRE, and records that Lovable disputes it because each customer is responsible for protecting their own app's data.

February 2026: one showcased app, 16 flaws

The Register reported that a researcher found 16 vulnerabilities, six of them critical, in a single app hosted on Lovable and featured on its Discover page, exposing 18,697 user records, many of them teachers and students. One of the main bugs was an access check in a database function written backwards: it blocked signed-in users and let anonymous visitors through. Lovable answered that its scan before publishing had made recommendations that were not applied, that the project included code not generated by Lovable, and that the vulnerable database was not hosted by Lovable. A check that RLS is on does not see a logic bug like this one; a code review or one request from outside does.

April 2026: public projects' chats and code

The Register also reported a researcher's claim that any free account could read other users' chat history and source code on public projects, including database credentials found in that code. Lovable first said it had not suffered a data breach, and that the code of public projects is visible by design. It then explained that projects have been private by default on every plan since December 2025, and that a February 2026 change to its permission system had accidentally re-enabled access to chats on public projects, which it reverted.

How to check your Lovable app

Six checks, from the cheapest to the most telling. The first four happen inside Lovable and change nothing.

  1. 1

    Run both scans

    Open the project's Security view and run the Deep scan, not only the Quick scan you get on publish. Read every finding, including the ones marked ignored, and note which tables and functions they name.

  2. 2

    Read your policies

    Go to More → Database → Manage → Policies. The view is read-only. Look for policies that apply to anon, rules with no condition, and policies for authenticated whose expression never mentions auth.uid(). Each of those lets in more people than you probably meant.

  3. 3

    Query the database

    Open More → Database → Manage → SQL editor and run the queries below. They read the system catalog of your own project and change nothing.

  4. 4

    Search the code for secret keys

    In the code editor or your synced Git repository, search for sk_live_, sk-, service_role, sb_secret_ and PRIVATE KEY. The .env file should hold only public values such as VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY. A Supabase key written as a JWT (a long string starting with eyJ) hides its role, so paste it into the Supabase key checker; the API key leak checker recognises other common key formats.

  5. 5

    Use the app as a stranger

    Open the published app in a private window, signed out, and try every page and form. Then sign up with a second account and try to open the first account's records, for example by changing an id in the address bar. If you see someone else's data, you have an IDOR.

  6. 6

    Check visibility and members

    Confirm the project is private, and remove workspace members who no longer need access.

sql
-- 1. Tables with RLS off, and what the public key may do there
select c.relname as table_name,
       has_table_privilege('anon', c.oid, 'select') as anon_select,
       has_table_privilege('anon', c.oid, 'insert') as anon_insert
from pg_class c
join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'public'
  and c.relkind in ('r', 'p')
  and not c.relrowsecurity;

-- 2. Policies that let every caller through
select tablename, policyname, cmd, roles
from pg_policies
where schemaname = 'public'
  and (qual = 'true' or with_check = 'true');

-- 3. Functions anon can call, owner-privileged ones first
select p.proname as function_name,
       p.prosecdef as runs_as_owner,
       has_function_privilege('anon', p.oid, 'execute') as anon_can_call
from pg_proc p
join pg_namespace n on n.oid = p.pronamespace
where n.nspname = 'public'
  and p.prokind = 'f'
order by runs_as_owner desc, function_name;
Run it in your own project. Any row in the first two results is a lead to fix. In the third, a function that runs as its owner and that anon can call deserves a careful read.

Fixes, with prompts for Lovable

Lovable changes policies and functions through its chat, so the fastest fix is a precise prompt. Paste one at a time, then reopen the policies view to confirm what changed.

Lock every table

text
Enable row level security on every table in the public schema. For each table that stores user data, add policies so a signed-in user can only read, insert, update and delete rows where user_id equals auth.uid(). Add no policy for the anon role unless I name the table. Then list every policy you created or changed.

Compare what it wrote with the pattern below. The first two policies are the ones scans and attacks turn up most; the third is the fix.

sql
-- Leaks: every visitor reads every profile
create policy "Profiles are viewable" on public.profiles
  for select using (true);

-- Leaks too: any stranger who signs up reads every profile
create policy "Signed-in users can view profiles" on public.profiles
  for select to authenticated using (true);

-- Fixed: each user reads only their own row
create policy "Users view their own profile" on public.profiles
  for select to authenticated using ((select auth.uid()) = user_id);

The Supabase RLS guide has policies for teams, shared records and public read with owner write. The RLS checker reviews the policies you paste, in your browser.

Protect edge functions

text
In every edge function that calls an AI model, sends email, or reads or changes user data, reject requests that do not carry a valid signed-in user session and return 401. Check that the user owns the record they ask for. Add a per-user rate limit to the AI functions.

An AI function that answers anyone runs up a bill you pay. See unprotected AI endpoints. For payments, ask Lovable to verify the Stripe-Signature header with the webhook signing secret before handling any event, as covered in Stripe webhook security.

Move secrets to the server

text
Find every API key or secret in the frontend code and in .env that is not meant to be public. Move each one to Secrets, read it only in an edge function or server code, and tell me which keys I must rotate at the provider.

Rotate at the provider, not only in Lovable: a key that shipped in a build has already been copied. Leaked API key: what to do gives the order of operations.

Check server code and storage

text
Review every server function and edge function that uses an admin or service role client. Before each read or write, check that the signed-in user owns the record. Make the uploads bucket private and add storage policies so each user can only read and write files in a folder named after their user id.

The service role key skips RLS by design, so any code holding it has to do the checking itself. The service role key guide explains when it belongs on a server and when finding it is a breach. For buckets, see Supabase storage security.

The traps after the first fix

  • The Deep scan is a snapshot. It does not run as you work, and the Quick scan never reads code. A feature added after your last Deep scan has not been reviewed, so run it again before each publish that adds data or functions.
  • New features rewrite policies. When a prompt asks for something the current policies block, loosening a policy is a common shortcut for any coding agent. Reopen the policies view after each feature that touches data.
  • `.env` is committed on purpose. Lovable needs .env in the repository so builds get their VITE_ values. Anything you put there is in your Git history, and every VITE_ value your code uses ends up in the browser bundle.
  • Your own Supabase project is your job. If you connected Supabase instead of the built-in backend, Lovable's password rotation does not cover it, and its keys and settings are yours to manage. The Supabase security guide covers that side.
  • Only critical dependency flaws become findings. High-severity ones do not, and some critical ones are held back when Lovable judges them unable to affect its apps or unlikely to be exploited (they stay in the project's dependency list with a marker). Run npm audit on a synced copy from time to time.
  • Auto-fix has limits. It picks up a few critical database and dependency findings from the Quick scan during your build requests, uses credits, and never fixes Deep scan findings. Fix those from the Security view or the chat, then reopen the policies view.

Test the published app, not only the code

Scans read what you wrote. An attack shows what your published app answers, which is exactly what a stranger gets. Lovable's own docs draw the same line and offer Aikido's pentests as an option. Keybrum runs this kind of test against the stack Lovable generates. It:

  • reads, inserts and updates rows in every table it finds, as anon and as a freshly signed-up account;
  • calls your RPC functions, lists and uploads to storage buckets, and subscribes to realtime channels;
  • sends a short test prompt to edge functions that look like AI endpoints, to see whether a model answers without an account;
  • looks for secret keys in your bundle and in table rows anyone can read;
  • tries to open one account's records from a second account, and sends unsigned Stripe webhook events.

Each finding comes with the request that worked and the fix. A coding agent such as Cursor or Claude Code reads them through Keybrum's MCP server, or you paste the fix into Lovable's chat. Keybrum only attacks apps whose owner proved ownership, and on a plan it attacks again on every deploy, so a policy loosened next week shows up next week.

Lovable security checklist

  • The project is private, and keys from any period when it was public have been rotated
  • The Deep scan ran after the last feature that touched data, and every finding is fixed or explained
  • Every table in public has RLS on, and no policy uses the condition true unless the data is meant to be public
  • Policies for authenticated compare the row's owner to auth.uid()
  • Functions that run as their owner cannot be called by anon, unless that is intended
  • Buckets with private files are private, with per-user folder policies
  • .env holds only public values; secret keys live in Secrets and were rotated if they ever shipped
  • Edge functions that call AI, send email or change data require a signed-in user and have a rate limit
  • Stripe webhooks verify the signature
  • Leaked-password protection is on (built-in backend: More → Users → Settings → Email, Password HIBP check)
  • A second test account cannot see the first account's data
  • The published app was tested from outside after the last deploy

The vibe coding security checklist extends this list to other AI builders, and vibe coding security risks explains why the same bugs keep coming back.

Questions

Is Lovable safe to use?

As a platform, yes for most uses: it hosts your app, manages the database, scans each publish and holds SOC 2 Type II and ISO 27001:2022 certifications. Your app's safety depends on its RLS policies, where its keys live and whether its functions check the caller, and Lovable's docs make that your responsibility. Run the Deep scan and test the published app before real users arrive.

Is Lovable AI safe for my private data?

Lovable says projects have been private by default on every plan since December 2025. When a feature needs an API key, enter it through the secure input Lovable shows, so it is stored as an encrypted secret that never reaches the browser. If a project was ever public, rotate any key that appeared in its chat or code.

Has Lovable had a security breach?

Lovable says it has not suffered a data breach. In April 2026 The Register reported that any account could read the chats and code of public projects: Lovable said public code is visible by design, and that a February 2026 backend change had wrongly re-enabled access to public project chats, which it reverted. Separately, CVE-2025-48757 covers apps built on Lovable with missing RLS, a CVE Lovable disputes.

What does the Lovable security scan check?

The Quick scan runs on every publish and checks database rules, critical npm vulnerabilities and MCP servers exposed without authentication, without reading your code. The Deep scan adds a code review for access control, unauthenticated endpoints, injection, leaked secrets and exposed personal data, but only runs when you start it. Both are static analysis.

Is the Supabase key in my Lovable app's code a leak?

Not if it is the publishable key in VITE_SUPABASE_PUBLISHABLE_KEY: Lovable's docs say it is safe to be public, and every visitor's browser has it. It gives the anon role, so your RLS policies decide what it reaches. A key starting with sb_secret_, or a JWT key whose role is service_role, in frontend code is a real leak.

Do I still need a pentest if I use Lovable's scans?

The built-in scans read your code; they do not send requests to the running app. For an app with user data or payments, test it from outside: Lovable offers Aikido as an option, and Keybrum attacks the published app and retests on every deploy. The free check is a quick first look at what a stranger sees.

Can Lovable fix security issues for me?

Partly. In the Security view, Try to fix all draws on 10 free fixes per account, each available again 24 hours after use; past that, fixes use credits. Auto-fix, which adds a few critical Quick scan findings to your build requests, uses credits and does not handle Deep scan findings. Reopen the policies view after any fix to see what changed.

Sources

  1. 1.Security overview, Lovable Documentation
  2. 2.Built-in backend, Lovable Documentation
  3. 3.Secrets, Lovable Documentation
  4. 4.Control who can access your app's data, Lovable Documentation
  5. 5.Database (SQL editor), Lovable Documentation
  6. 6.Edge functions, Lovable Documentation
  7. 7.FAQ: tech stack and compliance, Lovable Documentation
  8. 8.CVE-2025-48757, NIST National Vulnerability Database
  9. 9.Statement on CVE-2025-48757, Matt Palmer
  10. 10.Lovable-hosted app littered with basic flaws exposed 18K users, researcher claims, The Register
  11. 11.Vibe coding upstart Lovable denies data leak, cites 'intentional behavior,' then throws HackerOne under the bus, The Register

Your app is public. So are its mistakes.

Check what any attacker can already see in it, free, in ten seconds. The full attack, with proof and fixes: €49 once, or €29 a month on a plan.

or continue with Google or GitHub