Postgres RLS Write Gap: Green Isolation Tests Can Hide Cross-Tenant Data Corruption
A subtle flaw in PostgreSQL Row-Level Security (RLS) configuration can allow one tenant to overwrite another tenant's records, even when all isolation tests pass as green. The issue surfaces when developers fix a seeding error caused by FORCE ROW LEVEL SECURITY by relaxing the WITH CHECK clause to WITH CHECK (true), which disables write-side enforcement while leaving read filters intact. This means cross-tenant UPDATE statements without a WHERE clause can silently move rows between tenants, a vulnerability that existing read-only isolation assertions cannot detect. The correct approach is to omit WITH CHECK entirely, letting Postgres apply the USING expression to both reads and writes by default. Developers using Symfony or any framework that seeds fixtures as the table owner under FORCE RLS should audit their policies to ensure write-path enforcement has not been inadvertently removed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in