Two-account cross-tenant test
two_account_testDetect cross-account data leaks in Supabase tables by creating two test users, inserting data as one, and attempting to read, update, and delete as the other via REST API.
Instructions
Creates two temporary users (needs the service role key ONLY for that and for cleanup), inserts a row as user A into each table, then tries to read/update/delete it as user B and as anon through the normal REST API. Reports which tables leak across users. Deletes the test rows and users afterwards. Give sampleRow for tables with required columns.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| tables | Yes | ||
| anonKey | No | ||
| serviceRoleKey | No | service_role key (or env SUPABASE_SERVICE_ROLE_KEY). Used only to create/delete the two test users and clean up rows. |