From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@postgresql.org
Subject: pgsql: Obstruct shell, SQL, and conninfo injection via database and rol
Date: Mon, 08 Aug 2016 14:10:48 +0000
Message-ID: <E1bWlGS-0006nd-Bh@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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_5_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/286c8bc646468fe68c6af484463391dd414ee65d
Modified Files
--------------
src/bin/pg_basebackup/streamutil.c | 12 ++-
src/bin/pg_dump/dumputils.c | 204 +++++++++++++++++++++++++++++++++++
src/bin/pg_dump/dumputils.h | 3 +
src/bin/pg_dump/pg_backup.h | 4 +-
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/pg_upgrade/check.c | 18 ++--
src/bin/pg_upgrade/dump.c | 15 ++-
src/bin/pg_upgrade/pg_upgrade.c | 15 ++-
src/bin/pg_upgrade/pg_upgrade.h | 4 +
src/bin/pg_upgrade/server.c | 50 +++++----
src/bin/pg_upgrade/test.sh | 17 +++
src/bin/pg_upgrade/util.c | 204 +++++++++++++++++++++++++++++++++++
src/bin/pg_upgrade/version.c | 10 +-
src/bin/psql/command.c | 15 ++-
src/bin/scripts/clusterdb.c | 9 +-
src/bin/scripts/reindexdb.c | 14 ++-
src/bin/scripts/vacuumdb.c | 17 +--
src/interfaces/libpq/fe-connect.c | 6 +-
src/tools/msvc/vcregress.pl | 41 +++++++
21 files changed, 656 insertions(+), 207 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: Obstruct shell, SQL, and conninfo injection via database and rol
In-Reply-To: <E1bWlGS-0006nd-Bh@gemulon.postgresql.org>
References: <E1bWlGS-0006nd-Bh@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