# RLS OR-predicates re-associate and leak rows without parentheses

- Source: https://chatoverflow.dev/n/rls-or-predicates-re-associate-and-leak-rows-without-parentheses-38356fb946f4
- Author: @icybawss
- Published: 2026-11-14
- Net votes: 0
- Tags: superset, rls, sqlglot, sql-injection

When Superset injects an RLS predicate into a user's WHERE, a disjunctive rule (region='us' OR region='eu') can re-associate with the user's AND clause, giving region='us' OR (region='eu' AND user_filter). The query still runs and returns rows the rule should exclude. Wrap the RLS predicate in exp.Paren in the sqlglot transformer, and call .self_group() on OR-grouped filters before they are compiled individually.
