VibeCPR

← All fixes

Lovable · Supabase · Security checks

Lovable won't publish because of security findings? What each finding means and how to fix it

Updated · Applies to: Lovable, Supabase

TL;DR fix: Lovable runs its automatic security checks when you open the Publish dialog (database access rules, vulnerable packages, an MCP server open without sign-in). By default findings don't block publishing: the dialog shows a count, and on the built-in backend Lovable opens Review security findings with Review, Publish anyway and Try to fix. If a workspace admin turned on Block publishing with critical issues, the dialog lists Resolve findings under Before you publish and you can't publish until every critical finding is fixed or ignored. Open More → Security → Findings, group by severity, fix the Critical ones (the table below maps each kind to a tested fix), run the checks again, then test with a logged-out window and two accounts. Don't ignore a real finding just to get past the block: ignoring hides it, it doesn't fix it.

Steps

  1. Work out which kind of block you hit. A count on the security line or the Review security findings dialog is a warning: you can still publish. Resolve findings under Before you publish means your workspace turned on Block publishing with critical issues. Approval needed or Publishing blocked is an Enterprise workspace policy. Publishing failed or Fix build errors is not a security finding at all.
  2. Open the findings and sort by severity. Go to More → Security → Findings, open the Group menu and choose Severity. Open each Critical finding and read its Evidence and What could happen, and use Open source file to see the code it points to.
  3. Run the 2-minute database audit. Paste the read-only audit SQL from this page into the Supabase SQL editor. It lists tables with RLS off, policies with USING (true) or WITH CHECK (true), policies on tables where RLS is off, views that skip RLS, SECURITY DEFINER functions anon can call, and public storage buckets.
  4. Fix each critical finding with the matching fix. Use the table on this page to go from each finding to its fix. Use Try to fix or Fix all if you like, but read the diff and check that it didn't just loosen a policy or delete the feature.
  5. Ignore only what is intended, with the right reason. A public insert-only contact form or a public read-only catalog can be intended. Ignore those with This is intended. Never ignore a finding about private data, keys or other users' rows just to get past the block.
  6. Run the checks again and test as an outsider. Click Run checks in the Security view (advanced checks take about 3 to 13 minutes), then test logged out and with two accounts: user A must not read or change user B's rows. Publish when Critical is empty.

What it looks like

You click Publish in Lovable and one of these happens. Labels are quoted from Lovable’s docs (fetched Nov 26, 2026); we didn’t use a Lovable account for this page.

  • The security line in the Publish dialog shows a count. It shows how many critical findings are open, or, if there are none, how many warnings to review. You can still publish.
  • A “Review security findings” dialog opens when you click Publish. It lists up to three findings and has Review, Publish anyway (Update anyway on a published project) and Try to fix. Lovable’s docs describe this for projects on its built-in backend with unresolved critical findings.
  • “Resolve findings” under “Before you publish”, and the Publish button doesn’t go through. Your workspace has Block publishing with critical issues turned on. The Review security findings dialog doesn’t open in this case. Asking Lovable to publish in chat is refused with a count of critical findings, and the Lovable API / MCP server returns HTTP 400 security_critical_findings.
  • “Approval needed” or “Publishing blocked”, or “Sensitive data” under Before you publish. These are Enterprise workspace policies, not code findings. Ask a workspace admin or owner.
  • “Publishing failed” or “Fix build errors”: a build, configuration or connection problem, not a security finding. Use the banner’s Try again or Try to fix.

Why it happens

Lovable runs two groups of security checks (Security overview):

  • Automatic checks run on their own before you publish, and in the background when the Publish dialog opens (plus a connected scanner such as Wiz). They cover Database security (for example “a table without per-row rules (row-level security), a rule that lets everyone in, or leaked-password protection disabled”, plus file storage rules), Public tool access (an MCP server your app offers without sign-in) and Vulnerable dependencies. For Supabase-connected projects, Lovable’s Supabase docs say these checks look at RLS coverage too.
  • Advanced checks read all of your app’s code. They take about 3 to 13 minutes and don’t run in the Publish dialog. You start them from the Security view, the workspace Security center or the project chat, or Enterprise workspaces schedule them.

Each finding is labeled Critical, Warning or Info, and sorted into categories: Sign-in and accounts, Access permissions, Private data, Keys and passwords, User input, App actions, Payments and paid features, App settings and dependencies.

Two details that trip people up:

  • The block uses the latest result of every check, even outdated ones. With Block publishing with critical issues on, critical findings from the advanced checks, the dependency check and Aikido pentests count too. An old advanced-check finding you already fixed can still block you until you Run checks again.
  • Severity depends on who can open the app. A finding that would be Critical on a public app shows as a Warning when its code can only be reached after signing in (your website access setting). Secrets in code keep their level. Website access doesn’t protect your database, though: Lovable’s own docs say the publishable key “works from anywhere, not only from your app”. Making the app invite-only can turn a red finding yellow while the data is still reachable through the API.

Step 1: the 2-minute check

In Lovable: open More → Security → Findings, open the Group menu and choose Severity. Click Open on each Critical finding and read Evidence and What could happen. Open source file jumps to the code. If the Security check card says results are out of date, click Run checks first.

In Supabase (or ask Lovable to run it): on Lovable + Supabase apps, many findings are about the database. This read-only query lists the database problems Lovable’s docs describe, with the name Supabase’s Security Advisor uses for each. We tested it on PostgreSQL 17 (see what we verified). Paste it into the SQL editor:

-- VibeCPR audit: database-side security problems in the public schema. Read-only.
with t as (
  select c.oid, c.relname, c.relrowsecurity rls,
         (select count(*) from pg_policy p where p.polrelid = c.oid) npol
  from pg_class c join pg_namespace n on n.oid = c.relnamespace
  where n.nspname = 'public' and c.relkind in ('r','p')
)
select 'RLS off' as finding, relname as object,
       case when has_table_privilege('anon', oid, 'select') then 'anon can read every row' else 'no anon grant' end as detail
from t where not rls and npol = 0
union all
select 'Policies exist but RLS off', relname, npol || ' policies are ignored' from t where not rls and npol > 0
union all
select 'RLS on, no policies', relname, 'API sees 0 rows (safe, app may look empty)' from t where rls and npol = 0
union all
select 'Policy lets everyone in', tablename || ' / ' || policyname,
       cmd || ' to ' || array_to_string(roles, ',') ||
       case when qual = 'true' then ' USING (true)' else '' end ||
       case when with_check = 'true' then ' WITH CHECK (true)' else '' end
from pg_policies where schemaname = 'public' and (qual = 'true' or with_check = 'true')
union all
select 'View skips RLS (no security_invoker)', c.relname, 'runs as owner ' || pg_get_userbyid(c.relowner)
from pg_class c join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'public' and c.relkind in ('v','m')
  and not exists (select 1 from unnest(coalesce(c.reloptions, '{}')) o where o ~* '^security_invoker=(true|on|yes|1)$')
union all
select 'SECURITY DEFINER function callable by ' ||
       case when has_function_privilege('anon', p.oid, 'execute') then 'anon' else 'authenticated' end,
       p.proname || '(' || pg_get_function_identity_arguments(p.oid) || ')', 'runs as ' || pg_get_userbyid(p.proowner)
from pg_proc p join pg_namespace n on n.oid = p.pronamespace
where n.nspname = 'public' and p.prosecdef
  and (has_function_privilege('anon', p.oid, 'execute') or has_function_privilege('authenticated', p.oid, 'execute'))
union all
select 'Public storage bucket', id, 'files readable by URL without sign-in' from storage.buckets where public
order by 1, 2;

On our test schema it flagged all 9 planted problems. After the fixes below, only two RLS-on-no-policy tables (intended) and an intended public contact form were left. Limits: it only looks at public (add your other exposed schemas), it matches only the literal true condition (a policy like using (auth.uid() is not null) lets every signed-in user in and isn’t flagged), and materialized views can’t have security_invoker (keep them out of the API instead).

Which fix for which finding

Lovable’s docs don’t publish the exact title of every finding, so match on what the finding’s Evidence describes. The lint names are what Supabase’s Security Advisor calls the same problem. Lovable doesn’t say its checks use those lints.

The finding describesLovable categorySupabase lintFix
A table without row-level securityDatabase security (automatic)0013_rls_disabled_in_publicCheck RLS in two minutes, rules only in the frontend
Policies exist but RLS isn’t enabledDatabase security0007_policy_exists_rls_disabledalter table ... enable row level security; then test (new-row errors after enabling)
A rule that lets everyone in (USING (true) / WITH CHECK (true))Database security / Private data0024_permissive_rls_policyUSING (true) makes a table public, triage “always true” policies
Users can change their own plan, role or is_adminAccess permissions / Payments and paid featuresnoneStop users upgrading themselves
A view that skips RLSPrivate data / Access permissions0010_security_definer_viewsecurity_invoker views
A function anyone can call that skips RLSApp actions / Access permissions0028 / 0029SECURITY DEFINER callable via /rest/v1/rpc
File storage rules: public bucket, listableDatabase security (storage)0025_public_bucket_allows_listingPublic Storage bucket
Server code doesn’t follow the database’s ownership rulesAccess permissionsnoneServer uses the service_role key
Realtime sends rows to the wrong usersPrivate datanoneRealtime RLS
Anyone with a Google account can sign inSign-in and accountsnoneRestrict Sign in with Google
Leaked-password protection disabledDatabase security / Sign-in and accountsnoneTurn it on
API keys or secrets in codeKeys and passwordsnoneFind and fix leaked keys, Stripe keys in agent config
Backend route anyone can trigger without limits (AI, email, SMS)App actionsnoneRate limits and spend caps
Payment webhook doesn’t verify signaturesPayments and paid featuresnoneStripe webhook signatures
MCP server open without sign-inPublic tool access (automatic)noneRequire sign-in
Vulnerable packageApp settings and dependenciesnoneDependencies page → Fix all; e.g. Vite dev server RCE

The category column is our mapping from Lovable’s category descriptions, not something Lovable publishes per finding. The “Lovable category” for a given finding is shown on the finding itself. Trust that over this table.

Fix A: fix it in Lovable, then check the diff

Try to fix (in the Review security findings dialog), Fix on a finding, Fix all on the Findings page and the notice above the chat input all send the findings to Lovable as one chat request. They use your 10 free fixes (each comes back after 24 hours), then credits. Before you accept the result:

  • Read the SQL migration. A “fix” that drops a policy and adds using (auth.uid() is not null) turns “anyone” into “any signed-in user”. Anyone can sign up, so that’s often no better.
  • Check it didn’t remove the feature: a public page that now shows nothing because the table has RLS and no policy.
  • Run checks again. The fix doesn’t clear the advanced-check findings until they rerun.

Fix B: fix the database findings by hand

These are the fixes from the linked pages, applied to our test schema. Each one closed its finding in our test (what we verified):

-- RLS off: turn it on. With no policy, only server code with the secret key can read it.
alter table public.leads enable row level security;
revoke all on public.leads from anon, authenticated;
-- Policies written but RLS never enabled: enable it so the policies apply
alter table public.orders enable row level security;
-- "Lets everyone in": replace with an owner-only rule
drop policy "Anyone can read profiles" on public.profiles;
drop policy "Anyone can update profiles" on public.profiles;
create policy "Own profile" on public.profiles for select to authenticated
  using (id = (select auth.uid()));
-- View that skipped RLS: make it run as the caller
alter view public.payment_totals set (security_invoker = on);
-- SECURITY DEFINER function anyone could call
revoke execute on function public.get_all_emails() from public, anon, authenticated;

If users need to edit their own profile, add an owner-only UPDATE policy and protect columns like plan and role (how). For buckets, follow the public bucket fix rather than flipping public off blindly: public image URLs in your app will stop loading.

Fix C: leaked-password protection

The Database security check can flag leaked-password protection being off. It rejects passwords found in the Have I Been Pwned database.

  • Built-in backend (Lovable Cloud): turn on Password HIBP check in More → Users → Settings → Email (per Lovable’s docs).
  • Your own Supabase project: see Supabase’s password security guide. Supabase says leaked password protection is available on the Pro plan and above. On Free you can’t turn it on, so decide whether to upgrade or accept the risk (and ignore the finding with I accept this risk).

Fix D: public tool access (MCP without sign-in)

If you added agent integrations and chose Public — no login, every active tool can be called by anyone with the MCP link. Lovable makes you choose this explicitly and warns when you publish publicly. Workspace-published apps can’t publish with it at all. Switch the integration to require sign-in in More → AI → Agent integrations, unless every tool is truly safe for anyone (read-only, public data, no cost per call).

When ignoring or publishing anyway is OK

Lovable’s Ignore finding reasons are This is intended, I accept this risk, This is wrong and Other. Ignored findings move to the Ignored tab and stop counting toward the publish block. Reasonable cases:

  • A contact form or waitlist: INSERT ... WITH CHECK (true) for anon, with no SELECT policy. Our audit still lists it, and it’s fine. Our test confirmed anon could insert but not read.
  • A public catalog or blog: SELECT USING (true) on a table with nothing private in any column.
  • A finding that’s wrong: the code it points to was deleted. Run checks first. It may just be outdated.

Not OK: anything in Private data or Keys and passwords, any rule that lets one user read or change another user’s rows, and any finding you don’t understand. Publish anyway follows the same rule: fine for a reviewed, intended finding, never for open customer data.

Security notes

  • Passing the check isn’t proof. Lovable’s docs say the checks “can’t guarantee that your app is secure”, that the Publish dialog doesn’t run the advanced checks, and that passing the block “does not prove that your app is secure”. Info findings aren’t counted.
  • Test from the outside. Open the live app in a private window, and use two test accounts: A must not read or edit B’s rows. Hit the REST API with only the publishable key (how).
  • Invite-only isn’t RLS. Restricting website access lowers some severities but doesn’t change what the publishable key can reach through the API.
  • Don’t let the “fix” use the service_role key. Moving a query to a server function with the secret key makes the finding disappear and skips RLS for everyone (why).
  • Re-run after every big change. New tables, new views and new functions can each bring a finding back. If you’ve published 2 or more times since the advanced checks last ran, the Security view suggests running them again.

Paste this into Lovable, Bolt, Cursor or Claude Code

Publishing is showing critical security findings. Work through them without loosening
security to make them go away:

1. List every open Critical finding from the Security view (More -> Security -> Findings)
   with its category, the code or table it points to, and what could happen. Don't change
   anything yet.
2. Run this read-only audit in the database and show me the result: tables in public with
   RLS off, policies with USING (true) or WITH CHECK (true), policies on tables where RLS
   is off, views without security_invoker, SECURITY DEFINER functions that anon or
   authenticated can execute, and public storage buckets.
3. For each table, tell me who should be able to read, insert, update and delete rows
   (anyone / any signed-in user / only the owner / admins / server only). Wait for my
   answer before writing policies.
4. Then fix: enable RLS on every public table; owner-only policies using
   (select auth.uid()); security_invoker = on for views; revoke execute from public, anon
   and authenticated on SECURITY DEFINER functions that outsiders shouldn't call; users
   must not be able to change plan, role or is_admin columns.
5. Do NOT disable RLS, do NOT add USING (true) or auth.uid() is not null as a fix,
   do NOT move queries to the service_role/secret key, and do NOT delete features.
6. Re-run the security checks and the audit, and give me a test: logged out sees no
   private data; user A cannot read or change user B's rows.

What we verified

  • From Lovable’s official docs (fetched Nov 26, 2026, all HTTP 200; list and raw copies in research/lovable-security-findings-2026-11-26.md): the automatic and advanced checks and what each covers; that the Publish dialog runs only the automatic checks plus a connected scanner; “Findings don’t block publishing by default”; the Review security findings dialog (built-in backend, unresolved critical findings, up to three listed, Review / Publish anyway / Update anyway / Try to fix, Try to fix doesn’t publish); Block publishing with critical issues (location, all plans, default off except new Enterprise workspaces Lovable creates, Resolve findings under Before you publish, chat refusal, API/MCP 400 security_critical_findings, outdated results count, ignored findings don’t count); the finding categories, severity labels and the Critical → Warning rule for sign-in-only code; Ignore reasons; the 10 free fixes and 24-hour reset; advanced checks taking about 3 to 13 minutes; Password HIBP check location; Public — no login for agent integrations; the publishable key “works from anywhere”.
  • From Supabase’s docs (same day): the lint names and numbers, and that leaked password protection is Pro plan and above.
  • Tested locally (Nov 26, 2026; throwaway PostgreSQL 17.12 cluster with Supabase-like anon, authenticated and BYPASSRLS roles, Supabase-style default grants, auth.uid() from request.jwt.claims, a stand-in storage.buckets; research/lovable-security-findings-test/run.sh, output run.out.txt):
    • The audit query flagged all 9 planted problems: RLS off (leads, “anon can read every row”), policies with RLS off (orders), RLS on with no policy (notes), three true policies (public SELECT, authenticated UPDATE, anon INSERT), a view without security_invoker, an anon-callable SECURITY DEFINER function and a public bucket. It ran the same as a non-superuser owner role.
    • Before the fixes: anon read 2 of 2 leads, 2 of 2 profiles and 2 of 2 orders (the policy was ignored because RLS was off); signed-in Bob changed Alice’s plan to enterprise through the USING (true) WITH CHECK (true) UPDATE policy; Bob saw 2 rows in the definer view against 1 in the invoker view; anon got 2 emails from the SECURITY DEFINER function; anon saw 0 rows in the no-policy table.
    • After Fix B: anon 0 profiles and 0 orders; Bob 1 profile, 1 order, 1 row in the view; Bob’s update of Alice’s plan changed nothing; anon got “permission denied” on leads and on the function; anon could still insert into the contact form but read 0 of its rows. The re-audit listed only the intended items.
  • Not tested / not verified: we didn’t use a Lovable account or see its UI, so the labels above are quoted from the docs, not screenshots. Lovable doesn’t document the exact title of each finding, or whether its database checks use Supabase’s linter. The docs describe the Review security findings dialog only for the built-in backend. Not tested on real Supabase or PostgREST.
  • Our reading, not documented: the category column in the mapping table, and that many findings on Lovable + Supabase apps are database findings.

Related: check your RLS in two minutes, USING (true) makes a table public, Bolt’s “RLS Policy Always True” warning, your app is public to anyone with the link, and Lovable “Invalid API key” after rotating Supabase keys.

When to get help

Get help if a critical finding is about private data or keys and the app is already live with real users, if Try to fix keeps breaking features or comes back with the same finding, if your workspace blocks publishing and you have a deadline, or if you don't know whether a finding is intended.

FAQ

Why won't Lovable let me publish my app because of security findings?

By default it will. Lovable's publish docs say "Findings don't block publishing by default". If the dialog lists Resolve findings under Before you publish, a workspace admin or owner has turned on Block publishing with critical issues (Workspace settings → Security → Privacy & security → Publishing). Then nobody can publish while critical findings are unresolved. New Enterprise workspaces that Lovable creates start with it on. Fix or ignore every critical finding, or ask the admin about the setting.

What does "Publish anyway" in Lovable's Review security findings dialog do?

It publishes your app with the critical findings still open (on a published project the button reads Update anyway). Lovable shows this dialog when your project uses its built-in backend and has unresolved critical findings. The other buttons are Review, which opens the Security view, and Try to fix, which sends the critical findings to Lovable in the project chat and does not publish. Publish anyway is the right call only if you have read each finding and it doesn't expose data or keys.

Is it safe to ignore a Lovable security finding?

Only if the behaviour is really intended, like a public contact form that lets anyone insert but not read, or a product catalog anyone may view. Pick This is intended, I accept this risk or This is wrong as the reason. Ignored findings stop counting toward Block publishing with critical issues, but Lovable's docs say ignoring a finding does not fix the issue. Never ignore a finding about private data, keys or other users' rows.

Lovable says "no security issues". Is my app secure?

Not necessarily. The publish dialog runs only the automatic checks, not the advanced checks that read your code, and Info findings aren't counted. Lovable's own docs say the checks can't guarantee your app is secure and that passing the publish block doesn't prove it. Run the advanced checks from the Security view and test with a logged-out window and two accounts.

Why did a finding change from Critical to Warning after I made my app invite-only?

Lovable's advanced checks take website access into account: a finding that would be Critical on a public app shows as a Warning when its code can only be reached after signing in. Website access controls who can open the app's pages, though. Lovable's database docs say the publishable key "works from anywhere, not only from your app", so RLS still has to protect the database directly. Secrets in code keep their level.

Does Lovable's Try to fix or Fix all cost credits?

Fixes from the Security view, Fix all and Try to fix use your account's 10 free fixes. Each comes back 24 hours after you use it, and they are shared with Try to fix on build errors. After that, fixes are standard build usage and use credits. Running the checks is free. Asking Lovable to review your security in chat, or using Add to chat on a finding, uses credits.

What is the security_critical_findings error when I publish with the Lovable API or MCP server?

It is the API version of Block publishing with critical issues. With that setting on, a publish request through the Lovable API or the Lovable MCP server fails with HTTP 400 and error type security_critical_findings, listing the blocking findings. Asking Lovable to publish in chat or Slack is refused the same way. Fix the critical findings, then retry.

Sources

Related fixes