Anyone can read customer addresses and orders
WhereSupabase: public.profiles, public.orders, public.addresses
What's wrong
Supabase uses rules to decide who sees which rows in a table. Three tables have these rules off. So the database answers anyone who has the public key, and anyone can copy that key from your website.
Why it matters
One request can download every customer's name, phone number, home address and order history. You would likely have to report such a data leak. It can also end up on social media.
Evidence
-- Supabase SQL editor
select tablename, rowsecurity
from pg_tables where schemaname = 'public';
tablename | rowsecurity
-------------+------------
profiles | false
orders | false
addresses | false
meal_plans | true
-- From any laptop, with the key from the site's JavaScript:
-- curl "https://<project>.supabase.co/rest/v1/addresses?select=*" \
-- -H "apikey: <anon key>"
-- → 1,240 rows, every customer's addressThe fix
Turn on the rules for all three tables, with one rule each: customers see and change only their own rows. Then sign in as two customers and prove neither sees the other.
For your developer
Enable row level security on each table, then a policy per table: for all using (auth.uid() = user_id) with check (auth.uid() = user_id). profiles keys on id, not user_id. Check that the admin dashboard still works. It should use an edge function (see MB-02), not the anon client.
Evidence and developer notes
-- Supabase SQL editor
select tablename, rowsecurity
from pg_tables where schemaname = 'public';
tablename | rowsecurity
-------------+------------
profiles | false
orders | false
addresses | false
meal_plans | true
-- From any laptop, with the key from the site's JavaScript:
-- curl "https://<project>.supabase.co/rest/v1/addresses?select=*" \
-- -H "apikey: <anon key>"
-- → 1,240 rows, every customer's addressFor your developer
Enable row level security on each table, then a policy per table: for all using (auth.uid() = user_id) with check (auth.uid() = user_id). profiles keys on id, not user_id. Check that the admin dashboard still works. It should use an edge function (see MB-02), not the anon client.