From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make relation-enumerating operations be security-restricted oper
Date: Mon, 09 May 2022 15:37:46 +0000
Message-ID: <E1no5SD-000lVA-2P@gemulon.postgresql.org> (raw)
Make relation-enumerating operations be security-restricted operations.
When a feature enumerates relations and runs functions associated with
all found relations, the feature's user shall not need to trust every
user having permission to create objects. BRIN-specific functionality
in autovacuum neglected to account for this, as did pg_amcheck and
CLUSTER. An attacker having permission to create non-temp objects in at
least one schema could execute arbitrary SQL functions under the
identity of the bootstrap superuser. CREATE INDEX (not a
relation-enumerating operation) and REINDEX protected themselves too
late. This change extends to the non-enumerating amcheck interface.
Back-patch to v10 (all supported versions).
Sergey Shinderuk, reviewed (in earlier versions) by Alexander Lakhin.
Reported by Alexander Lakhin.
Security: CVE-2022-1552
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/ab49ce7c3414ac19e4afb386d7843ce2d2fb8bda
Modified Files
--------------
contrib/amcheck/expected/check_btree.out | 23 ++++++++
contrib/amcheck/sql/check_btree.sql | 21 +++++++
contrib/amcheck/verify_nbtree.c | 27 +++++++++
src/backend/access/brin/brin.c | 29 +++++++++-
src/backend/catalog/index.c | 65 ++++++++++++++++-----
src/backend/commands/cluster.c | 37 ++++++++----
src/backend/commands/indexcmds.c | 98 +++++++++++++++++++++++++++-----
src/backend/utils/init/miscinit.c | 24 +++++---
src/test/regress/expected/privileges.out | 55 ++++++++++++++++++
src/test/regress/sql/privileges.sql | 47 +++++++++++++++
10 files changed, 378 insertions(+), 48 deletions(-)
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: Make relation-enumerating operations be security-restricted oper
In-Reply-To: <E1no5SD-000lVA-2P@gemulon.postgresql.org>
References: <E1no5SD-000lVA-2P@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