pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. 6+ messages / 1 participants [nested] [flat]
* pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. @ 2018-02-26 15:42 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2018-02-26 15:42 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/582edc369cdbd348d68441fc50fa26a84afd0c1a Modified Files -------------- contrib/oid2name/oid2name.c | 13 ++++ contrib/vacuumlo/vacuumlo.c | 8 +- src/backend/postmaster/autovacuum.c | 14 ++++ src/bin/pg_basebackup/streamutil.c | 18 +++++ src/bin/pg_dump/pg_backup_db.c | 9 +++ src/bin/pg_dump/pg_dump.c | 17 ++++- src/bin/pg_dump/pg_dumpall.c | 6 +- src/bin/pg_rewind/libpq_fetch.c | 7 ++ src/bin/pg_upgrade/server.c | 3 + src/bin/scripts/clusterdb.c | 12 ++- src/bin/scripts/common.c | 137 +++++++++++++++++++++++++++++++--- src/bin/scripts/common.h | 10 ++- src/bin/scripts/createdb.c | 2 +- src/bin/scripts/createuser.c | 2 +- src/bin/scripts/dropdb.c | 3 +- src/bin/scripts/dropuser.c | 2 +- src/bin/scripts/reindexdb.c | 23 +++--- src/bin/scripts/t/010_clusterdb.pl | 2 +- src/bin/scripts/t/090_reindexdb.pl | 6 +- src/bin/scripts/t/100_vacuumdb.pl | 28 ++++++- src/bin/scripts/vacuumdb.c | 29 ++++--- src/fe_utils/string_utils.c | 16 ++-- src/include/fe_utils/connect.h | 28 +++++++ src/tools/findoidjoins/findoidjoins.c | 9 +++ 24 files changed, 338 insertions(+), 66 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. @ 2018-02-26 15:42 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2018-02-26 15:42 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/10d598354a31caea4e9cafa927f8b7311761ae51 Modified Files -------------- contrib/oid2name/oid2name.c | 13 ++++ contrib/vacuumlo/vacuumlo.c | 8 +- src/backend/postmaster/autovacuum.c | 14 ++++ src/bin/pg_basebackup/streamutil.c | 18 +++++ src/bin/pg_dump/pg_backup_db.c | 9 +++ src/bin/pg_dump/pg_dump.c | 17 ++++- src/bin/pg_dump/pg_dumpall.c | 6 +- src/bin/pg_rewind/libpq_fetch.c | 7 ++ src/bin/pg_upgrade/server.c | 3 + src/bin/scripts/clusterdb.c | 12 ++- src/bin/scripts/common.c | 137 +++++++++++++++++++++++++++++++--- src/bin/scripts/common.h | 10 ++- src/bin/scripts/createdb.c | 2 +- src/bin/scripts/createuser.c | 2 +- src/bin/scripts/dropdb.c | 3 +- src/bin/scripts/dropuser.c | 2 +- src/bin/scripts/reindexdb.c | 23 +++--- src/bin/scripts/t/010_clusterdb.pl | 2 +- src/bin/scripts/t/090_reindexdb.pl | 6 +- src/bin/scripts/t/100_vacuumdb.pl | 28 ++++++- src/bin/scripts/vacuumdb.c | 29 ++++--- src/fe_utils/string_utils.c | 16 ++-- src/include/fe_utils/connect.h | 28 +++++++ src/tools/findoidjoins/findoidjoins.c | 9 +++ 24 files changed, 338 insertions(+), 66 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. @ 2018-02-26 15:42 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2018-02-26 15:42 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e170b8c8c62064a16837c9838ef7a168fa9c9506 Modified Files -------------- contrib/oid2name/oid2name.c | 13 ++++ contrib/vacuumlo/vacuumlo.c | 8 +- src/backend/postmaster/autovacuum.c | 14 ++++ src/bin/pg_basebackup/streamutil.c | 18 +++++ src/bin/pg_dump/pg_backup_db.c | 11 +++ src/bin/pg_dump/pg_dump.c | 18 ++++- src/bin/pg_dump/pg_dumpall.c | 7 +- src/bin/pg_rewind/libpq_fetch.c | 7 ++ src/bin/pg_upgrade/server.c | 3 + src/bin/scripts/clusterdb.c | 12 ++- src/bin/scripts/common.c | 137 +++++++++++++++++++++++++++++++--- src/bin/scripts/common.h | 10 ++- src/bin/scripts/createdb.c | 2 +- src/bin/scripts/createlang.c | 4 +- src/bin/scripts/createuser.c | 2 +- src/bin/scripts/dropdb.c | 3 +- src/bin/scripts/droplang.c | 10 +-- src/bin/scripts/dropuser.c | 2 +- src/bin/scripts/reindexdb.c | 23 +++--- src/bin/scripts/t/010_clusterdb.pl | 2 +- src/bin/scripts/t/090_reindexdb.pl | 6 +- src/bin/scripts/t/100_vacuumdb.pl | 30 +++++++- src/bin/scripts/vacuumdb.c | 29 ++++--- src/fe_utils/string_utils.c | 16 ++-- src/include/fe_utils/connect.h | 28 +++++++ src/tools/findoidjoins/findoidjoins.c | 9 +++ 26 files changed, 347 insertions(+), 77 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. @ 2018-02-26 15:42 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2018-02-26 15:42 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/91f3ffc5249eff99c311fb27e7b29a44d9c62be1 Modified Files -------------- contrib/oid2name/oid2name.c | 13 ++++ contrib/vacuumlo/vacuumlo.c | 8 +- src/backend/postmaster/autovacuum.c | 14 ++++ src/bin/pg_basebackup/streamutil.c | 18 +++++ src/bin/pg_dump/dumputils.c | 16 ++-- src/bin/pg_dump/pg_backup_db.c | 11 +++ src/bin/pg_dump/pg_dump.c | 17 ++++- src/bin/pg_dump/pg_dumpall.c | 7 +- src/bin/pg_rewind/libpq_fetch.c | 7 ++ src/bin/pg_upgrade/server.c | 3 + src/bin/scripts/Makefile | 23 +++--- src/bin/scripts/clusterdb.c | 12 ++- src/bin/scripts/common.c | 137 +++++++++++++++++++++++++++++++--- src/bin/scripts/common.h | 10 ++- src/bin/scripts/createdb.c | 2 +- src/bin/scripts/createlang.c | 4 +- src/bin/scripts/createuser.c | 2 +- src/bin/scripts/dropdb.c | 3 +- src/bin/scripts/droplang.c | 10 +-- src/bin/scripts/dropuser.c | 2 +- src/bin/scripts/reindexdb.c | 23 +++--- src/bin/scripts/t/010_clusterdb.pl | 2 +- src/bin/scripts/t/090_reindexdb.pl | 6 +- src/bin/scripts/t/100_vacuumdb.pl | 30 +++++++- src/bin/scripts/vacuumdb.c | 29 ++++--- src/include/Makefile | 3 +- src/include/fe_utils/connect.h | 28 +++++++ src/tools/findoidjoins/findoidjoins.c | 9 +++ 28 files changed, 360 insertions(+), 89 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. @ 2018-02-26 15:42 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2018-02-26 15:42 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/928bca1a30d7e05cc3857a99e27aa8ed08ed2fac Modified Files -------------- contrib/oid2name/oid2name.c | 13 ++++ contrib/pg_upgrade/server.c | 3 + contrib/vacuumlo/vacuumlo.c | 8 +- src/backend/postmaster/autovacuum.c | 14 ++++ src/bin/pg_basebackup/streamutil.c | 18 +++++ src/bin/pg_dump/dumputils.c | 16 ++-- src/bin/pg_dump/pg_backup_db.c | 11 +++ src/bin/pg_dump/pg_dump.c | 17 ++++- src/bin/pg_dump/pg_dumpall.c | 7 +- src/bin/scripts/Makefile | 23 +++--- src/bin/scripts/clusterdb.c | 14 ++-- src/bin/scripts/common.c | 137 +++++++++++++++++++++++++++++++--- src/bin/scripts/common.h | 10 ++- src/bin/scripts/createdb.c | 2 +- src/bin/scripts/createlang.c | 4 +- src/bin/scripts/createuser.c | 2 +- src/bin/scripts/dropdb.c | 3 +- src/bin/scripts/droplang.c | 10 +-- src/bin/scripts/dropuser.c | 2 +- src/bin/scripts/reindexdb.c | 21 +++--- src/bin/scripts/t/010_clusterdb.pl | 2 +- src/bin/scripts/t/090_reindexdb.pl | 4 +- src/bin/scripts/t/100_vacuumdb.pl | 24 +++++- src/bin/scripts/vacuumdb.c | 9 ++- src/include/Makefile | 3 +- src/include/fe_utils/connect.h | 28 +++++++ src/tools/findoidjoins/findoidjoins.c | 9 +++ 27 files changed, 335 insertions(+), 79 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. @ 2018-02-26 15:42 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2018-02-26 15:42 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3db38b0ceffd95be81573c884f4be21f79ca954a Modified Files -------------- contrib/oid2name/oid2name.c | 13 ++++ contrib/pg_upgrade/server.c | 3 + contrib/vacuumlo/vacuumlo.c | 8 +- src/backend/postmaster/autovacuum.c | 14 ++++ src/bin/pg_dump/dumputils.c | 16 ++-- src/bin/pg_dump/pg_backup_db.c | 11 +++ src/bin/pg_dump/pg_dump.c | 17 ++++- src/bin/pg_dump/pg_dumpall.c | 7 +- src/bin/scripts/Makefile | 23 +++--- src/bin/scripts/clusterdb.c | 12 ++- src/bin/scripts/common.c | 137 +++++++++++++++++++++++++++++++--- src/bin/scripts/common.h | 10 ++- src/bin/scripts/createdb.c | 2 +- src/bin/scripts/createlang.c | 4 +- src/bin/scripts/createuser.c | 2 +- src/bin/scripts/dropdb.c | 3 +- src/bin/scripts/droplang.c | 10 +-- src/bin/scripts/dropuser.c | 2 +- src/bin/scripts/reindexdb.c | 19 ++--- src/bin/scripts/vacuumdb.c | 9 ++- src/include/Makefile | 3 +- src/include/fe_utils/connect.h | 28 +++++++ src/tools/findoidjoins/findoidjoins.c | 9 +++ 23 files changed, 289 insertions(+), 73 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2018-02-26 15:42 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-02-26 15:42 pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. Noah Misch <noah@leadboat.com> 2018-02-26 15:42 pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. Noah Misch <noah@leadboat.com> 2018-02-26 15:42 pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. Noah Misch <noah@leadboat.com> 2018-02-26 15:42 pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. Noah Misch <noah@leadboat.com> 2018-02-26 15:42 pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. Noah Misch <noah@leadboat.com> 2018-02-26 15:42 pgsql: Empty search_path in Autovacuum and non-psql/pgbench clients. Noah Misch <noah@leadboat.com>
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