Step-by-step answer
Core 75 min6 stepsRow-level security that fails closed
Two synthetic firms in a real PostgreSQL 16 with forced row-level security, a non-owner application role and a per-transaction tenant, worked through the attacks that break weaker setups (no tenant, cross-firm reads and writes, a leaky pooled connection, the owner without FORCE, a BYPASSRLS role, a foreign key into another firm) and a sweep of every repository function with the other firm's IDs.
Back to the exercise