pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Ensure cached plans are correctly marked as dependent on role.
Date: Mon, 11 Nov 2024 15:00:50 +0000
Message-ID: <E1tAVuL-001Ji7-QJ@gemulon.postgresql.org> (raw)

Ensure cached plans are correctly marked as dependent on role.

If a CTE, subquery, sublink, security invoker view, or coercion
projection references a table with row-level security policies, 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.

Reported-by: Wolfgang Walther
Reviewed-by: Noah Misch
Security: CVE-2024-10976
Backpatch-through: 12

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4e51030af9e0a12d7fa06b73acd0c85024f81062

Modified Files
--------------
src/backend/executor/functions.c          |  6 +++
src/backend/rewrite/rewriteHandler.c      | 67 +++++++++++++++++++++++---
src/test/regress/expected/rowsecurity.out | 78 +++++++++++++++++++++++++++++++
src/test/regress/sql/rowsecurity.sql      | 44 +++++++++++++++++
src/tools/pgindent/typedefs.list          |  1 +
5 files changed, 190 insertions(+), 6 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1tAVuL-001Ji7-QJ@gemulon.postgresql.org>
Permalink:  ../E1tAVuL-001Ji7-QJ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tAVuL-001Ji7-QJ@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: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Ensure cached plans are correctly marked as dependent on role.
  In-Reply-To: <E1tAVuL-001Ji7-QJ@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