pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Handle RLS dependencies in inlined set-returning functions prope
Date: Mon, 08 May 2023 14:12:57 +0000
Message-ID: <E1pw1bl-0016dO-8q@gemulon.postgresql.org> (raw)

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_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/473626cf00babd829eb15c36b51dfb358d32bc95

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(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1pw1bl-0016dO-8q@gemulon.postgresql.org>
Permalink:  ../E1pw1bl-0016dO-8q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pw1bl-0016dO-8q@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Handle RLS dependencies in inlined set-returning functions prope
  In-Reply-To: <E1pw1bl-0016dO-8q@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox