Emergency · Cross-user read
sample · demo-notes.appTest user A read 214 of test user B's notes
RLS is on and notes has a select policy, so config checks pass. But the policy only asks "is someone signed in?", not "is this their note?". Anyone who signs up can read everyone's notes.
How we know
# signed in as test user A (redacted) GET /rest/v1/notes?user_id=eq.<user B>&select=id # response: 214 rows (ids hashed, contents never fetched)
Paste this SQL
drop policy "notes_select" on public.notes; create policy "notes_select_own" on public.notes for select to authenticated using ( (select auth.uid()) = user_id );
Or paste this into your AI tool
# Prompt for Lovable / Bolt / Cursor / Claude Code
In Supabase, the notes table's select policy is
"auth.uid() is not null". Replace it so a signed-in user
can only select rows where user_id = auth.uid().
Don't change insert/update/delete policies.