pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add security checks to the multivariate MCV estimation code.
Date: Sun, 23 Jun 2019 17:52:12 +0000
Message-ID: <E1hf6ey-0003SO-E5@gemulon.postgresql.org> (raw)

Add security checks to the multivariate MCV estimation code.

The multivariate MCV estimation code may run user-defined operators on
the values in the MCV list, which means that those operators may
potentially leak the values from the MCV list. Guard against leaking
data to unprivileged users by checking that the user has SELECT
privileges on the table or all of the columns referred to by the
statistics.

Additionally, if there are any securityQuals on the RTE (either due to
RLS policies on the table, or accessing the table via a security
barrier view), not all rows may be visible to the current user, even
if they have table or column privileges. Thus we further insist that
the operator be leakproof in this case.

Dean Rasheed, reviewed by Tomas Vondra.

Discussion: https://postgr.es/m/CAEZATCUhT9rt7Ui=Vdx4N==VV5XOK5dsXfnGgVOz_JhAicB=ZA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d7f8d26d9f4c0a574250ec53a03b3dc08d13796c

Modified Files
--------------
src/backend/statistics/extended_stats.c | 74 +++++++++++++++++++++++++++++----
src/test/regress/expected/stats_ext.out | 60 ++++++++++++++++++++++++++
src/test/regress/sql/stats_ext.sql      | 60 ++++++++++++++++++++++++++
3 files changed, 186 insertions(+), 8 deletions(-)



Message-ID: <E1hf6ey-0003SO-E5@gemulon.postgresql.org>
Permalink:  ../E1hf6ey-0003SO-E5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hf6ey-0003SO-E5@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: dean.a.rasheed@gmail.com
  Subject: Re: pgsql: Add security checks to the multivariate MCV estimation code.
  In-Reply-To: <E1hf6ey-0003SO-E5@gemulon.postgresql.org>
  References: <E1hf6ey-0003SO-E5@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