pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: In REFRESH MATERIALIZED VIEW, set user ID before running user co
Date: Mon, 09 May 2022 15:37:46 +0000
Message-ID: <E1no5SD-000lVP-4j@gemulon.postgresql.org> (raw)

In REFRESH MATERIALIZED VIEW, set user ID before running user code.

It intended to, but did not, achieve this.  Adopt the new standard of
setting user ID just after locking the relation.  Back-patch to v10 (all
supported versions).

Reviewed by Simon Riggs.  Reported by Alvaro Herrera.

Security: CVE-2022-1552

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/880511cb0bdfd75a29ada6b80bf6e4efe6bc27b4

Modified Files
--------------
src/backend/commands/matview.c           | 30 +++++++++++-------------------
src/test/regress/expected/privileges.out | 16 ++++++++++++++++
src/test/regress/sql/privileges.sql      | 17 +++++++++++++++++
3 files changed, 44 insertions(+), 19 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1no5SD-000lVP-4j@gemulon.postgresql.org>
Permalink:  ../E1no5SD-000lVP-4j@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1no5SD-000lVP-4j@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com
  Subject: Re: pgsql: In REFRESH MATERIALIZED VIEW, set user ID before running user co
  In-Reply-To: <E1no5SD-000lVP-4j@gemulon.postgresql.org>
  References: <E1no5SD-000lVP-4j@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