From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: In security-restricted operations, block enqueue of at-commit us
Date: Mon, 09 Nov 2020 15:35:42 +0000
Message-ID: <E1kc9Co-0003Ne-SQ@gemulon.postgresql.org> (raw)
In security-restricted operations, block enqueue of at-commit user code.
Specifically, this blocks DECLARE ... WITH HOLD and firing of deferred
triggers within index expressions and materialized view queries. 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. One can work around the vulnerability by disabling
autovacuum and not manually running ANALYZE, CLUSTER, REINDEX, CREATE
INDEX, VACUUM FULL, or REFRESH MATERIALIZED VIEW. (Don't restore from
pg_dump, since it runs some of those commands.) Plain VACUUM (without
FULL) is safe, and all commands are fine when a trusted user owns the
target object. Performance may degrade quickly under this workaround,
however. Back-patch to 9.5 (all supported versions).
Reviewed by Robert Haas. Reported by Etienne Stalmans.
Security: CVE-2020-25695
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/ff3de4c21a462f2da773848c53faedac88d6e54d
Modified Files
--------------
contrib/postgres_fdw/connection.c | 4 +++
src/backend/access/transam/xact.c | 13 +++++-----
src/backend/commands/portalcmds.c | 5 ++++
src/backend/commands/trigger.c | 12 +++++++++
src/test/regress/expected/privileges.out | 42 ++++++++++++++++++++++++++++++++
src/test/regress/sql/privileges.sql | 34 ++++++++++++++++++++++++++
6 files changed, 104 insertions(+), 6 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: In security-restricted operations, block enqueue of at-commit us
In-Reply-To: <E1kc9Co-0003Ne-SQ@gemulon.postgresql.org>
References: <E1kc9Co-0003Ne-SQ@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