pgsql: Handle RLS dependencies in inlined set-returning functions prope

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Handle RLS dependencies in inlined set-returning functions prope
Date: 2023-05-08 14:12:57
Message-ID: E1pw1bl-0016dF-77@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Handle RLS dependencies in inlined set-returning functions properly.

If an SRF in the FROM clause references a table having row-level
security policies, and we inline that SRF into the calling query,
we neglected to mark the plan as potentially dependent on which
role is executing it. This could lead to later executions in the
same session returning or hiding rows that should have been hidden
or returned instead.

Our thanks to Wolfgang Walther for reporting this problem.

Stephen Frost and Tom Lane

Security: CVE-2023-2455

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/04e5606045e4887463ac9070acfc52e060fe6583

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 7 +++++++
src/test/regress/expected/rowsecurity.out | 27 +++++++++++++++++++++++++++
src/test/regress/sql/rowsecurity.sql | 20 ++++++++++++++++++++
3 files changed, 54 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2023-05-08 15:24:54 pgsql: Adjust sepgsql expected output for 681d9e462 et al.
Previous Message Noah Misch 2023-05-08 13:17:52 pgsql: Replace last PushOverrideSearchPath() call with set_config_optio