Ship Sentinel

How to check if your Supabase app leaks data

Short answer

Open a private window and request your own table with the public key from that same app. A row in the response means a logged-out visitor can read it. Run this only on an app you own.

The public key is not the problem

Supabase expects the anon key, and the newer publishable key (sb_publishable_), to ship in the browser. Those keys only identify the app. API keys map a signed-out request to the anon Postgres role. Row Level Security and table grants decide which rows that role can touch. A secret key (sb_secret_) or a service_role key bypasses Row Level Security. Those do not belong in the browser.

Why it matters now

Crissy Field analysed 159,041 Lovable projects. 34,545 of them used Supabase. 24,664 sent Supabase records on first load with no login. Records containing email addresses were readable on 7,403 of those 24,664 sites (about 30%), across 10,560 tables. Crissy Field says that 30% is not a confirmed leak rate. It applies only to the 24,664 sites they examined more closely, and some of those emails may be public or test data. The same research was discussed on Hacker News on 14 Nov 2026.

UpGuard found 16,326 Supabase databases exposing readable tables, in research published on 23 September 2026.

The 5-minute test

1. Open the app in a private window so you are logged out.

2. In DevTools, open Network, reload, and find a request to rest/v1. Copy the apikey header. That is the public key. Do not copy a secret key.

3. Request one table. Replace the project ref, the table name, and the key:

curl "https://<ref>.supabase.co/rest/v1/<table>?select=*&limit=1" -H "apikey: <KEY>"

4. Read the result. A JSON row means that table is exposed to logged-out visitors. [] means the role could ask and no row matched, which is what you want when Row Level Security is on and no anon policy matches. An empty table also returns [], so an empty result is not proof by itself. An HTTP 401 or 403, or Postgres error 42501, means the role has no grant.

5. Call a table URL, not the bare /rest/v1/ root. A publishable key is rejected on that root even when table routes work. Send the key on the apikey header.

6. Repeat for every table in the exposed schema.

7. To see how many rows exist without downloading them, add Prefer: count=exact and Range: 0-0. The Content-Range header carries the count, such as 0-0/12 or */0.

8. Sign in as a second user and repeat. A policy that returns every row to any signed-in user is still open.

Common reasons it still leaks

  • Row Level Security is off on a table created in the SQL editor or by an AI tool. Security Advisor flags many of these.
  • A policy says to anon using (true). That returns every row the anon role can reach.
  • A policy says to authenticated using (true) while anonymous sign-ins are on, or signup is open. An anonymous session uses the authenticated role.
  • A view ignores Row Level Security on the tables under it. On Postgres 15 and newer, create the view with security_invoker = true.
  • A function is callable with rpc() by anon. Revoke execute from anon and from public. See database functions.
  • A service_role key or an sb_secret_ key is in the JavaScript bundle. Either one bypasses Row Level Security.
  • Tables that already had grants stay reachable after the 30 October 2026 change. That change stops new public tables from being exposed on their own. It does not close an old table.

A safe default

Change user_id to the column that stores the owner. Then add with check policies for insert, update, and delete. This does not grant anything to anon.

alter table public.orders enable row level security;
revoke all on table public.orders from anon, authenticated;
grant select, insert, update, delete on table public.orders to authenticated;

create policy "orders_select_own"
on public.orders
for select
to authenticated
using ((select auth.uid()) = user_id);

One test is not enough

The next AI edit can turn Row Level Security off again or publish using (true). Ship Sentinel re-checks every week and after a deploy webhook, once you have verified the domain. The report names tables and says whether rows exist. It does not store the rows.

The free check reads only the public page and its scripts. It does not test the database.

Read the Supabase RLS checker, verify your domain, compare pricing, or go back to the homepage.

Questions

Is it safe that my Supabase anon or publishable key is in my frontend?

Yes. The anon key and an sb_publishable_ key are meant to be public. Row Level Security and table grants decide what that key can read. Never put a secret key or a service_role key in the browser.

How do I know if RLS is enabled on my Supabase tables?

The Table Editor shows a flag, and Security Advisor lists tables that fail its checks. The most reliable test is still a logged-out request with the public key.

I enabled RLS and my AI said it is fixed. Am I safe?

Not necessarily. A policy of using (true) for anon still returns every row. Print the policies and run the logged-out request again, including as a second user.

Does Ship Sentinel's free check test my database?

No. The free check reads only the public page and its scripts. The Row Level Security test runs only after you prove you own the domain.