AUDIT-001 Cross-tenant select on "invoices" via service-role client
- Entry
GET /api/invoices/[id]- Path
- HTTP request → GET /api/invoices/[id] → id eq id (user-controlled) → createServiceRoleClient (service role, bypasses RLS) → public.invoices.select
- Why
- select on public.invoices filtered by user-controlled "id" through a service-role client, with no tenant/owner scoping. The handler authenticates the caller but never checks that the row belongs to them. RLS is enabled on public.invoices with 2 policies, but the service role bypasses it.
- Where
app/api/invoices/[id]/route.ts:6app/api/invoices/[id]/route.ts:14lib/supabase.ts:7- Rule
supabase.service-role-object-access-without-tenant-scope · CWE-639, CWE-284 · status likely · confidence 0.85