← Guides

Is your Lovable app exposing data? How to check after the Crissy Field study

· PlugLeak

How to check your own Lovable app for Supabase rows that load without login. What the Crissy Field study measured, the browser and SQL checks, and why a passive scan cannot see Row Level Security.

A Lovable app that stores data in Supabase ships a key in the JavaScript. That key is how the browser talks to the Data API. Supabase says a publishable key is safe to expose because it only reaches what Row Level Security allows (API keys). This page is how to check, on an app you own, whether a signed-out visitor can read rows you did not mean to publish.

What the Crissy Field study measured

Crissy Field GmbH published a study of Lovable projects, reported with Handelsblatt on November 2, 2026. The research page says that write-up presents a more recent analysis and updated figures than the Handelsblatt article. The counts below are from that page.

Using Common Crawl, they identified 159,041 Lovable projects from December 2025 to September 2026. Of those, 34,545 used Supabase. 24,664 websites sent database records from Supabase as soon as they loaded, without a login or any other interaction. The authors say that alone is not a security issue, because the data may be intended for public display. With further read-only requests using the same API key, they found records containing email addresses in 10,560 tables across 7,403 of those 24,664 websites (30%).

They say the 30% figure should not be read as a confirmed data leak rate. It applies only to those 24,664 websites. The Common Crawl sample is not representative of all Lovable applications. An email address in a row can be a public contact or test data, and the same method misses personal records that contain no email address. They downloaded parts of the datasets, not the full tables, and say the affected datasets may contain more than the records they retrieved. This page does not name any project from the study.

The study looked at Supabase. It says Lovable's own database features, introduced in late 2025, were less widely used and were not examined, and that similar misconfigurations may occur there too. If your app uses a Supabase project you can open, the checks below are the ones to run. If it uses Lovable's database, the Security view in the last section still reviews access rules, and you can read policies under More → Database → Manage → Policies (Security overview).

Why the key in the browser is normal

Supabase maps the key to a Postgres role (API keys):

  • A publishable key (sb_publishable_…), with nobody signed in, uses the anon role. The same key, with a user signed in through Supabase Auth, uses the authenticated role.
  • A legacy anon key is a long JWT whose payload role is anon. It does the same job as the publishable key.
  • A secret key (sb_secret_…) or a legacy service_role JWT uses the service_role role. That role has BYPASSRLS. Policies do not apply. Supabase says it must never go in a browser, a shipped app, or source control.

Postgres runs grants first, then Row Level Security. Grants decide whether the role may touch the table at all. Policies decide which rows that operation applies to. Supabase's warning on the Row Level Security page: a table in an exposed schema without RLS is readable and writable by any role with a grant on it. Enable RLS on every table in an exposed schema. On projects that still grant anon and authenticated by default, revoke those grants. Adding policies does not remove them. The Data API exposes the public schema by default.

So a publishable or anon key in DevTools is the key Supabase tells you to ship. Rows coming back to a signed-out browser are the thing to inspect. If the apikey value starts with sb_secret_, or a JWT in the bundle has role service_role, stop and follow the service_role guide before you reason about policies. That key skips them.

Check your own app in the browser

Do this only on an app you own or are allowed to test. Use a private window so you are signed out. A leftover session would send a user JWT, and you would be looking at the authenticated role instead of a stranger.

  1. Open the live app. Open DevTools (F12 or Inspect), then the Network tab.
  2. In the filter box, type rest/v1. Reload, then click through the pages a visitor can open with no account.
  3. Each match is a Data API call. The path looks like /rest/v1/table_name. The segment after rest/v1/ is the table (or the view, or rpc/function_name).
  4. Select the request. Read the response. HTTP 200 and a JSON array means those objects were returned with no user session. Read the fields. A public catalog can look like this on purpose. Customer emails, orders, private profiles, and anything you did not mean to show a stranger should not be in that array.
  5. Read the apikey request header. It should be the publishable key or the legacy anon key. A value starting with sb_secret_ is the secret key. A JWT needs the role check in the previous section.

An empty array means that request returned no rows. Either this key cannot see them, or the table is empty. Sign in as the owner, confirm the row exists, then repeat the private-window load before you treat empty as locked. A body with code 42501 and permission denied for table is a missing grant. The 42501 guide is that case. Disabling RLS does not add the privilege.

The page load is the first half of what the study separated from later reads. A table your screen never requests can still be reachable with the same public key. After the SQL list in the next section, note any public table that did not appear under rest/v1. The Supabase RLS checklist has a curl for your own project: publishable or anon key only, never the secret key.

Run Security Advisor and list tables without RLS

In the Supabase dashboard (Studio), open Security Advisor. Supabase documents it on the Advisors page, which is also the database linter. The same checks can be run with supabase db advisors. Findings can be intentional. Compare each one with the access you actually want.

The error 0013_rls_disabled_in_public is summarized as "Table publicly accessible". The linter says anyone with the project URL can read, edit, and delete all data in that table because Row Level Security is not enabled. The RLS guide states the condition in terms of grants: a table in an exposed schema without RLS is readable and writable by any role that already has a grant on it. On a project that still grants anon every privilege by default, a signed-out visitor holds that grant. Not every project grants it automatically, which is why the grant query below is part of the check.

The info finding 0008_rls_enabled_no_policy ("No access rules defined") is the other direction. RLS is on and no policy exists, so the API returns no rows. Supabase says some projects want that, and suggests a policy of using (false) when the intent is to reject every read. A blank screen after you enable RLS is this state. Write the policy you mean. A policy of to anon using (true) opens every row that role can already reach.

Then, in the SQL editor, list ordinary tables in public and whether RLS is on. This is the query from Tables and data. rowsecurity is the view of the Postgres flag relrowsecurity.

select tablename, rowsecurity
from pg_tables
where schemaname = 'public'
order by tablename;

Any row with rowsecurity false needs a decision. The SQL editor is a poor "is it locked?" test: the table owner and roles with BYPASSRLS are not subject to policies, so the same select can still return rows there (Tables and data).

List the privileges anon and authenticated still hold:

select table_name, grantee, privilege_type
from information_schema.role_table_grants
where table_schema = 'public'
  and grantee in ('anon', 'authenticated')
order by table_name, grantee, privilege_type;

anon should keep a privilege only for an operation a signed-out visitor is supposed to perform. SELECT on a public changelog can be right. SELECT on a table of private user rows should not. The RLS checklist walks through what to revoke.

Enable RLS, narrow the grants, keep the secret key off the page

Supabase's procedure for every exposed table is: enable RLS, revoke the client roles, grant back only the operations the app uses, then write one policy per operation (Row Level Security). This is the private-table version. Change your_table and user_id to your names. Run it in a migration if you have one.

alter table public.your_table enable row level security;

revoke all on table public.your_table from anon, authenticated;

grant select, insert, update, delete on table public.your_table to authenticated;

create policy "Users can read their own rows"
on public.your_table
for select
to authenticated
using ((select auth.uid()) = user_id);

Drop any privilege in that grant the app does not use. Postgres does not accept several operations in one for clause, so insert, update, and delete each need their own policy. The RLS checklist has those four, the public-read pattern (grant select to anon and authenticated, with using (true) only when every row is meant to be public), and the note that overlapping permissive policies are combined with or. One using (true) policy opens the operation even if a stricter policy sits beside it.

After enable row level security, Supabase says no data is accessible through the API with a publishable key until you create policies. That empty result is the closed state. It is a bad moment to "fix" the app by turning RLS off, by adding using (true) for anon, or by pointing the browser client at the service_role or sb_secret_ key. The secret key belongs on a server you control. The service_role guide is the removal and rotation if it is already in the frontend.

If a request your policy should allow returns 42501, the grant is missing and the policy never ran. Fix the grant. Leave RLS on. The linter's other option, removing public from Exposed schemas, fits a project that does not use the Data API. A Lovable app that reads Supabase from the browser is using that API, so keep the schema exposed and lock it with grants and policies.

Run Lovable's Security scan

In the project, open More → Security. That is the Security view. Two scans are built in (Security overview):

  • Quick scan. The card marked Automatic. It runs every time you publish. Its database review includes tables without per-record access control (row-level security) and access rules that let everyone through. Database checks run for projects with a connected database.
  • Deep scan. It reviews the application code, includes every Quick scan check, and reports access-control findings, including server code that bypasses the rules the database enforces, and exposed personal data in errors and logs. It does not run on its own while you work. Start it from the Security view, the workspace Security center, or the project chat (edit access required).

Running the Quick scan or the Deep scan is free and does not use credits, whether you start it in the Security view, the Security center, the publish dialog, or the project chat (Security overview). Lovable says the tools help identify common issues and cannot guarantee complete security, and that you are responsible for whether the app meets the security requirements of its use case. The Lovable app security check is the longer map of what each scan covers. Lovable also says to review RLS policies regularly, especially before publishing and after changes to authentication or database structure. A passing scan is a reason to re-read the policies, which you can open under More → Database → Manage → Policies.

Check again after you change it

Repeat the private-window Network filter for rest/v1. The tables that should be private should no longer return their rows while you are signed out. Run the pg_tables query again and confirm rowsecurity is true for each exposed table. Open Security Advisor again. Then sign in as a second test user, if the app has accounts, and confirm that user cannot read the first user's rows.

When the new version is on a public URL, run the free PlugLeak scan on that URL: https://plugleak.com/#scan. Every request is a GET. It fetches the page you submit and same-site JavaScript, and it does not start another batch of scripts once 25 files or 12 MB of JavaScript have been fetched. It requests /.env and /.git/config once each, and it checks security headers and the TLS certificate. In the HTML and those scripts it looks for Stripe secret keys, OpenAI-style keys, Anthropic keys, AWS access key IDs, GitHub tokens, PEM private keys, sb_secret_ keys, and JWTs with role service_role.

PlugLeak does not test Row Level Security or grants, query the database, log in, or crawl. A clean scan cannot tell you whether your tables are exposed. That answer is the browser check, Security Advisor, and the rowsecurity query above. How the free scan works lists every request. Paid fix reports include a full refund within 30 days of purchase, no questions asked (refund policy).

FAQ

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

A publishable key (sb_publishable_) or a legacy anon key is meant to be in the browser. It identifies the project. With nobody signed in it uses the anon Postgres role; with a signed-in Supabase Auth user it uses authenticated. Grants decide whether that role can touch a table, and Row Level Security decides which rows. A secret key (sb_secret_) or a legacy JWT whose role is service_role bypasses Row Level Security and does not belong in the frontend. Rows in a logged-out response are a separate check from the key itself.

How do I check whether my Lovable app loads Supabase data without login?

On an app you own, open a private window so no one is signed in. Open DevTools, then the Network tab, filter for rest/v1, and reload. A request to /rest/v1/ and then a table name, answered with HTTP 200 and a JSON array, returned those rows with no user session. An empty array means that request returned no rows: either the role cannot see them, or the table is empty. Confirm a row exists while you are signed in before you treat empty as locked. A 42501 permission denied for table is a missing grant. Do this only on your own app.

Does the Crissy Field figure of 30% mean Lovable apps are leaking data?

Crissy Field GmbH says the 30% figure should not be read as a confirmed data leak rate. They analyzed 159,041 Lovable projects found via Common Crawl from December 2025 to September 2026. 34,545 used Supabase. 24,664 sent Supabase records as soon as the page loaded, without a login. With further read-only requests using the same API key, they found records containing email addresses in 10,560 tables across 7,403 of those 24,664 sites (30%). They say that 30% applies only to those 24,664 sites, that the Common Crawl sample is not representative of all Lovable applications, that an email address may be a public contact or test data, and that the method misses personal records with no email address. They also say records sent on page load alone are not a security issue when the data is meant to be public.

Will PlugLeak tell me if my Supabase tables are exposed?

No. PlugLeak does not test Row Level Security or grants, query the database, log in, or crawl, so it cannot tell you whether your tables are exposed. Check that with the browser steps, Security Advisor, and the rowsecurity query on this page. The free scan at https://plugleak.com/#scan is a passive GET of the page and same-site JavaScript. It does not start another batch of scripts once 25 files or 12 MB of JavaScript have been fetched. It requests /.env and /.git/config, checks security headers and the TLS certificate, and looks for Stripe secret keys, OpenAI-style keys, Anthropic keys, AWS access key IDs, GitHub tokens, PEM private keys, sb_secret_ keys, and JWTs with role service_role.

Sources

Check your app now — free, passive, about 20 seconds.

Same scanner as the homepage scan. Paste the live URL. It reads what a visitor already downloads. It does not log in or query your database.