AI pentesting guides / By tech stack

Stack guide: Lovable

Security testing for Lovable apps

Security testing a Lovable app mostly means testing its Supabase backend: Lovable generates a React frontend that talks directly to Supabase, so whether a stranger can read your users' data depends on Row Level Security policies and on which keys and functions the app exposes.

This is not theoretical. CVE-2025-48757, published in 2025 and rated 9.3, described insufficient RLS policies in Lovable-generated sites that let unauthenticated users read or write arbitrary tables. Lovable has since added security scanning to its publish flow, which is a good first pass, and its own documentation says those tools do not replace a thorough security review.

Where Lovable apps leak

  • Tables created during iteration without RLS, or with a broad policy added to fix an error message.
  • Policies that check a user is signed in but not that the row is theirs.
  • Secret API keys pasted into the chat and written into frontend code instead of Supabase secrets used by an edge function.
  • Edge functions that accept any caller, or that use the service_role key and trust a user ID sent in the body.
  • Storage buckets for user uploads set to public.

Testing the way an attacker would

Open your published app, take the Supabase URL and publishable key from the network tab, and use them directly against /rest/v1 for each table. Then sign up two accounts and try to read and modify one account's rows from the other. Repeat for storage paths and edge functions. Anything that works when it should not is a policy or function to fix, usually by prompting Lovable with the specific table and rule.

Keeping it fixed

Each new feature can add tables or functions. Re-run Lovable's scan and an external test after significant changes, not only at first launch. If you export the project to GitHub, add Supabase migrations with explicit policies to your review process.

With Pentest-Swarm

Testing a Lovable app with Pentest-Swarm

Pentest-Swarm tests your published app and its Supabase API from outside, over HTTP. It does not need access to your Lovable workspace or Supabase dashboard.

  • Set scope to your app's domain and your Supabase project host so both are tested and nothing else is.
  • Enable --browser so it records the Supabase calls your React frontend makes.
  • Provide a test user's session token with --auth, then a second user's, to test cross-user access.
  • Proven findings include the request that worked, which you can hand to Lovable as a precise fix prompt.

Where it falls short

An external test can only check tables and functions it discovers through the app or can infer, and it cannot read your RLS policy text. Use Lovable's scan and Supabase's Security Advisor alongside it. If a key was ever exposed, rotate it; fixing the code does not un-leak a key.

Questions

Is Lovable secure?

Lovable can produce secure apps, and it now scans before publishing. Security still depends on the policies and functions in your specific project, which is why testing the deployed app matters.

Is my Supabase anon key in the Lovable frontend a problem?

No, it is designed to be public. The problem is any table it can reach without proper RLS, or a service_role key in the frontend.

What was CVE-2025-48757?

A 2025 CVE describing insufficient Row Level Security in Lovable-generated sites that allowed unauthenticated access to database tables. The CVE record is marked disputed.

Sources

  1. NVD: CVE-2025-48757
  2. Lovable docs: Security