We built a small Supabase app on 11 November 2026 to show one mistake clearly. Row Level Security was switched on. The project's Security Advisor did not flag the policy. And a signed-in user still received another user's private note, with one ordinary request.

Everything below is from that project. It holds two test accounts and two notes, nothing real. The project address, keys and session token are cut short; nothing else is changed.

The setup

One table, notes, with an owner column and RLS enabled. The writes are scoped properly to the owner. The read policy is the one that turns up again and again in generated apps:

create table public.notes (
  id uuid primary key default gen_random_uuid(),
  owner_id uuid not null default auth.uid() references auth.users (id),
  title text not null,
  body text not null
);

alter table public.notes enable row level security;

create policy "Signed-in users can read notes"
  on public.notes for select
  to authenticated
  using (true);

Two users, Alice (user A) and Bob (user B). Bob has one note: "Invoice 1042 overdue. Call the client on Friday."

Before testing, we ran Supabase's Security Advisor on the project. It returned one warning, that leaked-password protection was disabled. It said nothing about the read policy on notes. That is not a criticism of the advisor. A rule that lets signed-in users read a table is sometimes exactly what you want, and only you know whether notes is meant to be shared.

The request

Alice signs in through the normal Supabase auth endpoint and gets a session token. Then she asks the REST API for notes belonging to Bob's user id:

GET https://wtrwjj….supabase.co/rest/v1/notes?owner_id=eq.23c3562e-b967-4886-82bb-76a7ed5cd7b9&select=title,body
apikey: sb_publishable_…(redacted)
Authorization: Bearer <Alice's session token>

Nothing clever. Any signed-in user can send this from a terminal or the browser console, and the app's own screens never need to show Bob's id for it to work: ids leak through URLs, shared links and API responses all the time.

The response

HTTP/2 200
content-type: application/json; charset=utf-8

[
  {
    "title": "Bob's private note",
    "body": "Invoice 1042 overdue. Call the client on Friday."
  }
]

Here it is happening, 25 seconds, no sound:

Recorded against the demo project. The token and keys on screen are shortened.

RLS did exactly what the policy told it to. USING (true) means "every row passes", so for select, every signed-in user can read every note. The app's own screens filter by the current user, which is why nobody notices in testing. The filter lives in the front end. The API does not use it.

The write attempts looked like they worked

We also had Alice try to change and delete Bob's note:

PATCH /rest/v1/notes?owner_id=eq.23c3…  →  HTTP 204
DELETE /rest/v1/notes?owner_id=eq.23c3…  →  HTTP 204

Two 204s. Read naively, that is "success". Then we checked Bob's note in the database: unchanged. The update and delete policies were scoped to the owner, so RLS filtered Bob's row out and both requests touched zero rows. PostgREST still answers 204 when a filter matches nothing.

The lesson cuts both ways. A 204 is not proof that a write leak exists, and it is not proof that one does not. After any write test, sign in as the other user and look.

The fix

Replace the read policy with one that names the owner:

drop policy "Signed-in users can read notes" on public.notes;

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

Wrapping auth.uid() in a select is Supabase's own performance advice for RLS; it does not change who can see what.

Then rerun the identical request as Alice:

HTTP/2 200

[]

An empty list. Alice still sees her own note when she asks for all notes, so the app keeps working. That before-and-after pair is the evidence worth keeping: the same request, the same user, a different answer.

If notes are meant to be shared within a team, the policy should check team membership instead of ownership. The multi-tenant authorisation guide covers that shape.

Run this on your own app

You do not need us for the first pass. On your own project, ideally staging:

  1. Search the live bundle for service_role, sb_secret_ and sk_live_. Any match is a fail.
  2. Call each table with only the public key and no session. Rows coming back is a fail, unless the table is public on purpose.
  3. Read every policy as a sentence. USING (true) on a table that holds someone else's data is a fail, even with TO authenticated.
  4. Two accounts, one request. Sign in as A, ask for B's row by id, then try to update and delete it. Check as B afterwards.
  5. Private files and payments. Open a private file's URL signed out. Confirm your Stripe webhook verifies the signature against the raw body.

Each check, with the exact commands, is on the five checks page. The longer Supabase RLS audit adds SQL to list every table and policy at once. Supabase's own Row Level Security guide and the PostgreSQL CREATE POLICY reference explain how USING and WITH CHECK combine. This mistake class is OWASP's top web risk, broken access control.

If you are about to take payments or let real users in and would rather not run check 4 yourself, that is the 5-day two-account check.

What this demo does not show

One table, one policy, one mistake. A real app has sign-in flows, storage, server functions, admin routes and payment callbacks, and any of them can leak in ways this request would never touch. Passing this test does not mean an app is safe to launch, and it is not a penetration test.