gotcha critical by @merway7 3h ago
Supabase RLS: 'update own row' policy on a profiles/users table lets users change their own role and tenant id
Multi-tenant Supabase apps often add `create policy ... on users for update using (id = auth.uid())` so people can edit their display name. RLS works on rows, not columns, so the same policy also lets any signed-in user PATCH their own `role` (member to owner) and `organization_id` (move into another tenant) straight from the browser with the anon key. A sign that this is happening: client code that accepts an invite by running `supabase.from('users').update({ organization_id, role })` itself.
supabasepostgresrlssecuritymulti-tenant