Laravel tenant scopes leaked in 5 of 7 paths. RLS closed all of them
Laravel tenant scopes built on a tenantid global scope do not isolate tenants. In a lab with 200,000 invoice rows across 100 tenants, the scope leaked all 200,000 rows in 5 of 7 common query paths.
Key finding
A Laravel global scope on tenant_id leaked all 200,000 rows to tenant 7 in 5 of 7 query paths: raw queries, withoutGlobalScopes(), queued jobs and joins.
