pgsql: Obstruct shell, SQL, and conninfo injection via database and rol

Поиск
Список
Период
Сортировка
От Noah Misch
Тема pgsql: Obstruct shell, SQL, and conninfo injection via database and rol
Дата
Msg-id E1bWlGS-0006og-Io@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Obstruct shell, SQL, and conninfo injection via database and role names.

Due to simplistic quoting and confusion of database names with conninfo
strings, roles with the CREATEDB or CREATEROLE option could escalate to
superuser privileges when a superuser next ran certain maintenance
commands.  The new coding rule for PQconnectdbParams() calls, documented
at conninfo_array_parse(), is to pass expand_dbname=true and wrap
literal database names in a trivial connection string.  Escape
zero-length values in appendConnStrVal().  Back-patch to 9.1 (all
supported versions).

Nathan Bossart, Michael Paquier, and Noah Misch.  Reviewed by Peter
Eisentraut.  Reported by Nathan Bossart.

Security: CVE-2016-5424

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/95a6855c5508fed7e327fe28e6d3ffb614a406bf

Modified Files
--------------
contrib/pg_upgrade/dump.c            |  15 ++-
contrib/pg_upgrade/pg_upgrade.c      |  15 ++-
contrib/pg_upgrade/pg_upgrade.h      |   4 +
contrib/pg_upgrade/server.c          |  50 +++++----
contrib/pg_upgrade/test.sh           |  17 +++
contrib/pg_upgrade/util.c            | 204 +++++++++++++++++++++++++++++++++++
contrib/pg_upgrade/version.c         |  10 +-
contrib/pg_upgrade/version_old_8_3.c |  34 ++++--
src/bin/pg_basebackup/streamutil.c   |   9 +-
src/bin/pg_dump/dumputils.c          | 204 +++++++++++++++++++++++++++++++++++
src/bin/pg_dump/dumputils.h          |   3 +
src/bin/pg_dump/pg_backup.h          |   2 +-
src/bin/pg_dump/pg_backup_archiver.c |  34 ++++--
src/bin/pg_dump/pg_backup_db.c       |   9 +-
src/bin/pg_dump/pg_dumpall.c         | 162 +++-------------------------
src/bin/psql/command.c               |  15 ++-
src/bin/scripts/clusterdb.c          |   9 +-
src/bin/scripts/reindexdb.c          |  14 ++-
src/bin/scripts/vacuumdb.c           |  10 +-
src/interfaces/libpq/fe-connect.c    |   6 +-
src/tools/msvc/vcregress.pl          |  41 +++++++
21 files changed, 665 insertions(+), 202 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: pgsql: Fix Windows shell argument quoting.
Следующее
От: Noah Misch
Дата:
Сообщение: pgsql: Obstruct shell, SQL, and conninfo injection via database and rol