LeakLatch

For Lovable + Supabase apps

Is my Lovable app leaking Supabase keys?

Direct answer

A Supabase anon or publishable key in your Lovable frontend is normal. A service_role key, an sb_secret_ key, or any other server secret in the JavaScript bundle is a leak — rotate it and take it off the client. Even with only the anon key, tables can be readable to strangers if Row Level Security is off or the policies are too broad.

LeakLatch is a free, read-only scan of a live URL you own. It checks the page and its JS bundles for leaked secrets, and it reports Supabase tables that are readable without RLS. You get a risk score, redacted findings, and a prompt you can paste into Lovable, Cursor, or Claude.

Owner checks

How to check your own site

Use these on an app you own or have permission to test. They are pre-ship checks, not a penetration test, and they do not involve writing to the database.

  1. Step 1

    Search the live JavaScript for secret keys

    Open your production URL (not only the Lovable preview). View source, then open the JS bundles listed there. Search for service_role, sb_secret_, sk_live, sk_test, sk-proj-, and AWS access key prefixes such as AKIA. A Supabase URL and an anon or publishable key in the client are expected. A service_role JWT, sb_secret_ key, Stripe secret key, or other server token is not — rotate it and move it off the client.

  2. Step 2

    Confirm which Supabase key you shipped

    The anon key is designed to be in the frontend. It only stays safe if Row Level Security is enabled and the policies are correct. The service_role key bypasses RLS. If that key is in a bundle, treat it as public, rotate it in the Supabase dashboard, and keep the new one in a server-side environment variable or an edge function.

  3. Step 3

    Check RLS in the Supabase dashboard

    In the Supabase project, open Advisors → Security Advisor and fix every error, including tables marked publicly accessible. In the Table Editor, confirm RLS is enabled on every table in an exposed schema. A table with RLS off, or with a policy such as USING (true) for the anon role, can be read by anyone who has the anon key from your page.

  4. Step 4

    Re-check after every Lovable deploy

    A later prompt can add a table, loosen a policy, or put a new secret into client code. Repeat the JS search and the Security Advisor pass on the live URL after each ship, not only on the first launch.

Copy-paste fix

Prompt you can paste into Lovable or Cursor

After you rotate any secret that already shipped, paste this into Lovable, Cursor, or Claude and point it at your own project.

You are helping me fix security issues on my own Lovable + Supabase site. Do not introduce new secrets into client-side code. Keep existing product behavior working.

1. Search the repo and any built frontend bundles for server secrets (Supabase service_role or sb_secret_ keys, Stripe sk_live / sk_test, OpenAI, AWS, and similar). Move every secret into server-side environment variables or edge functions. Never put them in Vite, NEXT_PUBLIC_, or other client-exposed env vars.
2. Enable Row Level Security on every Supabase table in an exposed schema. Replace policies that allow the anon role to read or write all rows (for example USING (true)). Add policies so a user can only access their own data, and so a logged-out request cannot list other people's rows.
3. Rotate any secret that was already shipped in a public bundle, then confirm the old value no longer works.
4. Do not log or print full secret values.

Why this comes up

This pattern is documented

Independent research on public Lovable projects found a large number of sites where a database responded as soon as the page loaded. The figures below are from that write-up, which LeakLatch also cites on the home page.

FAQ

Straight answers about keys and scans

Is a Supabase anon key in my Lovable app a leak?

No. The anon (or publishable) key is meant to be in the browser. The risk is missing or overly broad Row Level Security, or a different secret — especially service_role or sb_secret_ — ending up in the same bundle.

What should I do if I find a service_role or Stripe secret in the bundle?

Rotate the key first so the copied value stops working. Then move the new secret to a server-side environment variable or an edge function, remove it from client code, and redeploy. After that, search the new production bundle to confirm it is gone.

Can LeakLatch scan any site I find?

No. You must confirm you own the site or have permission to scan it. LeakLatch is read-only: it fetches the page and public JavaScript, and may make read-only GET requests to list table names and row counts when a public Supabase key is already on the page. It never writes to your database, never logs in, and never stores or shows row data.

Is this a substitute for a full security audit?

No. LeakLatch is a pre-ship check for leaked secrets, open Supabase tables, and basic headers. It does not replace a penetration test, a careful review of every RLS policy, or Supabase's own Security Advisor.

Want this check done for you, read-only?

Paste a URL you own. LeakLatch returns a score, redacted findings, and a fix prompt.

Scan my site free