pgsql: Fix security checks for selectivity estimation functions withRL

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема pgsql: Fix security checks for selectivity estimation functions withRL
Дата
Msg-id E1hNbCh-0004Pk-8r@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix security checks for selectivity estimation functions with RLS.

In commit e2d4ef8de8, security checks were added to prevent
user-supplied operators from running over data from pg_statistic
unless the user has table or column privileges on the table, or the
operator is leakproof. For a table with RLS, however, checking for
table or column privileges is insufficient, since that does not
guarantee that the user has permission to view all of the column's
data.

Fix this by also checking for securityQuals on the RTE, and insisting
that the operator be leakproof if there are any. Thus the
leakproofness check will only be skipped if there are no securityQuals
and the user has table or column privileges on the table -- i.e., only
if we know that the user has access to all the data in the column.

Back-patch to 9.5 where RLS was added.

Dean Rasheed, reviewed by Jonathan Katz and Stephen Frost.

Security: CVE-2019-10130

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/93c36145ad10f3b4795d8e411720ae55180ad274

Modified Files
--------------
src/backend/utils/adt/selfuncs.c          | 21 +++++++++++++++------
src/test/regress/expected/rowsecurity.out | 21 +++++++++++++++++++++
src/test/regress/sql/rowsecurity.sql      | 21 +++++++++++++++++++++
3 files changed, 57 insertions(+), 6 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Remove reindex_catalog test from test schedules.
Следующее
От: Dean Rasheed
Дата:
Сообщение: pgsql: Use checkAsUser for selectivity estimator checks, if it's set.