]> git.ipfire.org Git - thirdparty/postgresql.git/commit
In security-restricted operations, block enqueue of at-commit user code.
authorNoah Misch <noah@leadboat.com>
Mon, 9 Nov 2020 15:32:09 +0000 (07:32 -0800)
committerNoah Misch <noah@leadboat.com>
Mon, 9 Nov 2020 15:32:12 +0000 (07:32 -0800)
commitac8f6243cb002f3386322fb231a0c5daa637941d
treeb18cf3d0828fb444301c7f91d3a9372b578813f3
parenta98b46194434927b8402b08ac0edfa6408c7e823
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
contrib/postgres_fdw/connection.c
src/backend/access/transam/xact.c
src/backend/commands/portalcmds.c
src/backend/commands/trigger.c
src/test/regress/expected/privileges.out
src/test/regress/sql/privileges.sql