The detektd BriefNo. 16 · 9 Oct 2026
Secrets & exposed data26 Sept 20269 min read

16,326 Supabase databases anyone can read

A UpGuard study published on September 25, 2026 found 16,326 Supabase databases with tables anyone can read, with no authentication and no exploit required. The cause fits in one sentence: the Table Editor protects by default, the API AI agents actually use doesn't.

by detektd team

Aisle of a dark server room, racks lit by green and blue status lights
Photo: The National Archives (UK) · CC BY 3.0 · Wikimedia Commons

Yesterday, cybersecurity firm UpGuard published the results of a scan run across nearly 300,000 domains identified as running Supabase. To find them, researchers combined two sources: BuiltWith's technographic fingerprinting, and the Chrome UX Report dataset on BigQuery, which makes it possible to analyze the JavaScript files actually served by millions of sites. In those public bundles, they looked for the Supabase project URL and its "anon" key, then queried each database for a users table readable without authentication.

The result: 16,326 databases return rows to anyone who sends the request. No credentials, no token, no exploit: a standard HTTP request, the same one the application itself sends. More than half of those databases show indicators of personal data (names, addresses, phone numbers). A smaller share exposes passwords or authentication tokens, and a very small number, plausible payment card data.

0

Supabase databases with publicly readable tables, out of ~300,000 domains analyzed (UpGuard, Sep 25, 2026)

One methodological point deserves attention: UpGuard didn't browse user data. The team analyzed the structure of the exposed tables (their columns) to characterize what kind of information was present, rather than reading rows one by one. That's the right way to measure an exposure of this size without becoming a privacy problem yourself.

How Supabase decides who can read what

To understand the scale of the problem, you have to understand the architecture. Supabase exposes every Postgres database through PostgREST, a REST API generated automatically from the schema: every table in the public schema becomes an endpoint, queryable straight from the browser. The frontend authenticates with two things designed to be public: the project URL and the "anon" key (renamed the "publishable" key in the new key format Supabase introduced in 2025). That key isn't a secret. It necessarily ends up in the JavaScript sent to the browser, and that's expected.

So what protects the data isn't the key: it's Postgres itself. A request carrying the anon key runs under the anon Postgres role; a signed-in user's request, under the authenticated role. And Row Level Security (RLS) decides, row by row, what each of those roles is allowed to see or change. When RLS is on for a table with no policy at all, nobody sees anything. When RLS is off, the public schema's default grants apply, and they let those roles read and write.

Anon key shipped to the browser (expected)
PostgREST runs the request as the anon role
Table created with RLS off
Unlimited read and write

A path problem, not a feature problem

The root cause UpGuard documents isn't exotic. Supabase turns RLS on by default when a table is created from the dashboard's Table Editor, but not when it's created by a SQL migration or through the API. And that's exactly the path AI coding agents (Claude Code, Cursor, Lovable, Bolt...) take when they scaffold a schema: they write SQL, they don't click through a dashboard.

The trap works so well because it's invisible. A table without RLS works perfectly: the app shows its data, forms save, tests pass. Nothing in a functional test distinguishes "users see their own data" from "everyone sees everyone's data". Worse, the reverse path pushes in the wrong direction: if the agent turns RLS on without writing a policy, the app suddenly returns empty lists, and the quickest fix to "make the app work" is turning RLS off again, or adding a using (true) policy that allows everything.

"Systemic data exposure in Supabase apps."

Title of the UpGuard report, September 25, 2026

Moltbook: the textbook case

The most-cited example is Moltbook, a social network for AI agents launched on January 28, 2026 and entirely vibecoded: its founder publicly said they hadn't written a single line of code themselves. The project went viral within days. Researchers at Wiz then ran a non-intrusive review, browsing the platform like an ordinary user, and found the Supabase key in the site's JavaScript (which, as we've seen, is expected), but with no RLS policy behind it.

The consequence: full access, read and write, to the entire production database. 1.5 million API authentication tokens, 35,000 email addresses, and private messages exchanged between agents. Write access is the most worrying detail: it allowed not just reading but altering content published by any agent. Wiz reported the issue and fixed it with the Moltbook team within hours; data accessed during the research was deleted.

Moltbook isn't isolated; it's just the most visible. UpGuard's report documents other exposed databases, with equally concrete numbers, and above all victim profiles that are nothing like "demo projects":

  • A valet parking service: 100,000+ customers, 43,000 with name and email and 78,000 with license plates, plus a table of 665 employees (emails, phone numbers, push notification tokens).
  • An African consulate: 25,000 users, including addresses and emergency housing locations.
  • A Canadian immigration service: 5,000 records, 884 of them with a plain-text password.

Five ways to get RLS wrong

Turning RLS on isn't enough. Analyses published this year on AI-built apps distinguish five failure modes, from the crudest to the subtlest:

  1. RLS off: the table is fully open to the anon and authenticated roles. That's the case UpGuard measured.
  2. Permissive policy: RLS is on, but a using (true) policy lets everyone through. The box is ticked, the protection is zero.
  3. Partial coverage: reads are protected, but not inserts or updates: anyone can write rows on another user's behalf.
  4. Exposed service_role key: that key bypasses RLS by design. If it ends up in the client bundle, no policy protects anything anymore.
  5. auth.uid() misuse: a policy that compares against a column the user controls, or forgets that an anonymous user has a null uid.

What the fix actually looks like

RLS is enabled table by table, and each policy has to match a real access model. The bare minimum for a user-owned table covers both reads and writes. The with check clause is what stops someone inserting or updating a row on someone else's behalf:

Reads and writes limited to the owner
alter table public.projects enable row level security;

create policy "select own projects"
  on public.projects for select
  to authenticated
  using ((select auth.uid()) = owner_id);

create policy "insert own projects"
  on public.projects for insert
  to authenticated
  with check ((select auth.uid()) = owner_id);

create policy "update own projects"
  on public.projects for update
  to authenticated
  using ((select auth.uid()) = owner_id)
  with check ((select auth.uid()) = owner_id);

Two details matter. The to authenticated clause explicitly excludes anonymous visitors. And writing (select auth.uid()) rather than auth.uid() is the form the Supabase docs recommend: it lets Postgres evaluate the function once per query instead of once per row.

Under the hood: from JWT to Postgres role

To write a good policy, you need to know what Postgres "sees" when it runs. Every request reaching PostgREST carries a JWT: the anon key itself for a visitor, or the session token for a signed-in user. PostgREST checks its signature, reads the role claim and switches the transaction to that Postgres role (anon or authenticated). It then puts all the claims into a session setting, request.jwt.claims. Supabase's auth.uid() function does nothing more than read the sub claim back from that setting:

What auth.uid() does (simplified)
select (current_setting('request.jwt.claims', true)::jsonb ->> 'sub')::uuid;

-- anon visitor: no sub claim -> NULL
-- NULL = owner_id is never true, so a policy on auth.uid() denies anon by construction

That leaves the question of grants. On Supabase, tables created in the public schema get default GRANTs for the anon and authenticated roles: without RLS, those grants apply as-is. You can add a second line of defense, independent of policies, by explicitly revoking the anon role's privileges on tables that must never be read signed-out:

Defense in depth: no privileges for anon
revoke all on table public.projects from anon;

-- policies are only evaluated for roles that hold the privilege in the first place

The blind spots: views, functions, storage

Even with RLS correctly enabled on every table, three kinds of objects can bypass it without anyone noticing. The first is views. By default, a Postgres view runs with its owner's privileges: on Supabase, the postgres role, which isn't subject to RLS. A "summary" view on top of a protected table therefore becomes a back door to all its rows. Since Postgres 15, the security_invoker option makes the view run with the caller's privileges, and so respect their policies.

A view that respects RLS
create view public.project_summaries
  with (security_invoker = true) as
select id, name, created_at
from public.projects;

The second is functions. Every function in the public schema is callable through the API, at /rest/v1/rpc/<name>. A function declared SECURITY DEFINER runs with its creator's privileges and therefore ignores RLS: useful for controlled operations, dangerous if anon can call it. Two rules: pin its search_path so it doesn't resolve objects chosen by the caller, and revoke execute from roles that don't need it.

A privileged function, locked down
create or replace function public.admin_stats()
returns table (users bigint, projects bigint)
language sql
security definer
set search_path = ''
as $$
  select (select count(*) from auth.users), (select count(*) from public.projects);
$$;

revoke execute on function public.admin_stats() from public, anon, authenticated;

The third is file storage. Supabase Storage keeps file metadata in a table, storage.objects, also protected by RLS. But a bucket marked "public" serves its files to anyone who knows their URL, regardless of policies. And an overly broad read policy on storage.objects lets anyone list a bucket's contents, and so discover the URLs. Invoices, ID documents, exports: whatever sits in a public bucket is public.

Testing a policy as a specific user

Supabase's SQL Editor runs with a privileged role: a query that returns rows there proves nothing about what a user will see. You can, however, reproduce exactly what PostgREST does, inside a transaction you roll back at the end: switch role, set claims, and query the table.

Simulate a user, then an anonymous visitor
begin;
  set local role authenticated;
  set local request.jwt.claims = '{"sub": "<user-uuid>", "role": "authenticated"}';
  select count(*) from public.projects;  -- only this user's rows
rollback;

begin;
  set local role anon;
  select count(*) from public.projects;  -- expected: 0, or a permission error
rollback;

One last detail, on performance: a policy like (select auth.uid()) = owner_id is evaluated for every candidate row. Without an index on owner_id, every user query scans the whole table. A simple create index on public.projects (owner_id) makes the policy both safe and fast.

Checking your own project in two minutes

The first check happens on the database side. Postgres directly exposes the RLS state of every table; this query, run in Supabase's SQL Editor, lists every table in the public schema where it's off:

Public tables without RLS
select tablename
from pg_tables
where schemaname = 'public'
  and rowsecurity = false;

The second happens from the outside, exactly the way any visitor would: send your own API the request your frontend sends, with only the public key, while signed out. If it returns rows that shouldn't be public, the problem is real. The Supabase dashboard's Security Advisor also flags public-schema tables without RLS, a warning worth treating as an error, not a suggestion.

Test your own table while signed out
curl "https://<project-ref>.supabase.co/rest/v1/projects?select=*&limit=1" \
  -H "apikey: <your-anon-or-publishable-key>"

# expected for private data: []

If you work with an AI agent

Add the rule to your instructions file (CLAUDE.md, .cursorrules...): every table created must enable RLS and define explicit policies for select, insert, update and delete. And never let the agent "fix" an empty list by turning RLS off.

That's exactly what detektd's RLS check verifies on every scan of an app detected as running Supabase: whether the exposed public key can read or write tables with no policy matching their actual usage, from the outside, the way anyone could.

More in this section

16,326 Supabase databases anyone can read | detektd