postgresql/contrib/pg_upgrade
Noah Misch 928bca1a30 Empty search_path in Autovacuum and non-psql/pgbench clients.
This makes the client programs behave as documented regardless of the
connect-time search_path and regardless of user-created objects.  Today,
a malicious user with CREATE permission on a search_path schema can take
control of certain of these clients' queries and invoke arbitrary SQL
functions under the client identity, often a superuser.  This is
exploitable in the default configuration, where all users have CREATE
privilege on schema "public".

This changes behavior of user-defined code stored in the database, like
pg_index.indexprs and pg_extension_config_dump().  If they reach code
bearing unqualified names, "does not exist" or "no schema has been
selected to create in" errors might appear.  Users may fix such errors
by schema-qualifying affected names.  After upgrading, consider watching
server logs for these errors.

The --table arguments of src/bin/scripts clients have been lax; for
example, "vacuumdb -Zt pg_am\;CHECKPOINT" performed a checkpoint.  That
now fails, but for now, "vacuumdb -Zt 'pg_am(amname);CHECKPOINT'" still
performs a checkpoint.

Back-patch to 9.3 (all supported versions).

Reviewed by Tom Lane, though this fix strategy was not his first choice.
Reported by Arseniy Sharoglazov.

Security: CVE-2018-1058
2018-02-26 07:39:48 -08:00
..
.gitignore Update .gitignore for pg_upgrade 2014-12-17 11:57:29 +01:00
check.c pg_upgrade: start/stop new server after pg_resetwal 2017-06-20 13:20:02 -04:00
controldata.c Fix spelling mistake. 2016-01-14 23:15:27 -05:00
dump.c Ensure that all temp files made during pg_upgrade are non-world-readable. 2018-02-05 10:58:27 -05:00
exec.c pg_upgrade: simplify code layout in a few places 2018-01-05 14:11:14 -05:00
file.c Ensure that all temp files made during pg_upgrade are non-world-readable. 2018-02-05 10:58:27 -05:00
function.c pg_upgrade: fix CopyFile() on Windows to fail on file existence 2015-11-24 17:18:28 -05:00
IMPLEMENTATION Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
info.c pg_dump, pg_upgrade: allow postgres/template1 tablespace moves 2015-09-11 15:51:11 -04:00
Makefile Fix contrib/pg_upgrade to clean all the cruft made during "make check". 2014-01-02 14:20:28 -05:00
option.c pg_upgrade: fix CopyFile() on Windows to fail on file existence 2015-11-24 17:18:28 -05:00
page.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
parallel.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
pg_upgrade.c Repair pg_upgrade's failure to preserve relfrozenxid for matviews. 2018-02-21 18:40:24 -05:00
pg_upgrade.h Ensure that all temp files made during pg_upgrade are non-world-readable. 2018-02-05 10:58:27 -05:00
relfilenode.c pg_upgrade: fix CopyFile() on Windows to fail on file existence 2015-11-24 17:18:28 -05:00
server.c Empty search_path in Autovacuum and non-psql/pgbench clients. 2018-02-26 07:39:48 -08:00
tablespace.c pg_upgrade: fix CopyFile() on Windows to fail on file existence 2015-11-24 17:18:28 -05:00
test.sh Obstruct shell, SQL, and conninfo injection via database and role names. 2016-08-08 10:07:51 -04:00
TESTING Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
util.c Obstruct shell, SQL, and conninfo injection via database and role names. 2016-08-08 10:07:51 -04:00
version.c Obstruct shell, SQL, and conninfo injection via database and role names. 2016-08-08 10:07:51 -04:00
version_old_8_3.c Obstruct shell, SQL, and conninfo injection via database and role names. 2016-08-08 10:07:51 -04:00