pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Obstruct shell, SQL, and conninfo injection via database and rol
6+ messages / 1 participants
[nested] [flat]

* pgsql: Obstruct shell, SQL, and conninfo injection via database and rol
@ 2016-08-08 14:10  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2016-08-08 14:10 UTC (permalink / raw)
  To: 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(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Obstruct shell, SQL, and conninfo injection via database and rol
@ 2016-08-08 14:10  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2016-08-08 14:10 UTC (permalink / raw)
  To: 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_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


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Obstruct shell, SQL, and conninfo injection via database and rol
@ 2016-08-08 14:10  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2016-08-08 14:10 UTC (permalink / raw)
  To: 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_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/a2385cac135bb8498a12b1af2cde18244c7be2b1

Modified Files
--------------
contrib/pg_upgrade/check.c           |   5 +-
contrib/pg_upgrade/dump.c            |   5 +-
contrib/pg_upgrade/option.c          |   6 ++
contrib/pg_upgrade/pg_upgrade.c      |  18 ++--
contrib/pg_upgrade/pg_upgrade.h      |   5 +
contrib/pg_upgrade/server.c          |  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_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 |  24 +++--
src/bin/pg_dump/pg_backup_db.c       |   9 +-
src/bin/pg_dump/pg_dumpall.c         | 155 ++------------------------
src/bin/psql/command.c               |  15 ++-
src/bin/scripts/Makefile             |   2 +-
src/bin/scripts/clusterdb.c          |   9 +-
src/bin/scripts/reindexdb.c          |  14 ++-
src/bin/scripts/vacuumdb.c           |  11 +-
src/interfaces/libpq/fe-connect.c    |  13 ++-
21 files changed, 572 insertions(+), 193 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Obstruct shell, SQL, and conninfo injection via database and rol
@ 2016-08-08 14:10  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2016-08-08 14:10 UTC (permalink / raw)
  To: 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_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/254eb04f17b8c0a933ff0cdf2003339a460d778f

Modified Files
--------------
contrib/pg_upgrade/check.c           |  18 ++--
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   |  12 ++-
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           |  12 ++-
src/interfaces/libpq/fe-connect.c    |   6 +-
src/tools/msvc/vcregress.pl          |  41 +++++++
22 files changed, 680 insertions(+), 210 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Obstruct shell, SQL, and conninfo injection via database and rol
@ 2016-08-08 14:10  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2016-08-08 14:10 UTC (permalink / raw)
  To: 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
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fcd15f13581f6d75c63d213220d5a94889206c1b

Modified Files
--------------
src/bin/pg_basebackup/streamutil.c   | 12 +++++--
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       | 10 +++++-
src/bin/pg_dump/pg_dumpall.c         | 18 +++++++---
src/bin/pg_upgrade/Makefile          |  3 +-
src/bin/pg_upgrade/check.c           | 19 ++++++----
src/bin/pg_upgrade/dump.c            | 16 +++++++--
src/bin/pg_upgrade/pg_upgrade.c      | 16 +++++++--
src/bin/pg_upgrade/server.c          | 51 +++++++++++++++++----------
src/bin/pg_upgrade/test.sh           | 17 +++++++++
src/bin/pg_upgrade/version.c         | 11 ++++--
src/bin/psql/command.c               | 15 +++++++-
src/bin/scripts/clusterdb.c          | 10 +++++-
src/bin/scripts/reindexdb.c          | 14 ++++++--
src/bin/scripts/vacuumdb.c           | 17 +++++----
src/fe_utils/string_utils.c          | 67 ++++++++++++++++++++++++++++++++++--
src/include/fe_utils/string_utils.h  |  1 +
src/interfaces/libpq/fe-connect.c    |  6 +++-
src/tools/msvc/vcregress.pl          | 41 ++++++++++++++++++++++
20 files changed, 315 insertions(+), 67 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Obstruct shell, SQL, and conninfo injection via database and rol
@ 2016-08-08 14:10  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2016-08-08 14:10 UTC (permalink / raw)
  To: 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_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/e8f4922c8683881236b1feb11d4e8ea35ab41cd7

Modified Files
--------------
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_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 |  24 +++--
src/bin/pg_dump/pg_backup_db.c       |   9 +-
src/bin/pg_dump/pg_dumpall.c         | 155 ++------------------------
src/bin/psql/command.c               |  15 ++-
src/bin/scripts/Makefile             |   2 +-
src/bin/scripts/clusterdb.c          |   9 +-
src/bin/scripts/reindexdb.c          |  14 ++-
src/bin/scripts/vacuumdb.c           |  11 +-
src/interfaces/libpq/fe-connect.c    |   6 +-
src/tools/msvc/vcregress.pl          |  41 +++++++
19 files changed, 622 insertions(+), 192 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2016-08-08 14:10 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-08-08 14:10 pgsql: Obstruct shell, SQL, and conninfo injection via database and rol Noah Misch <noah@leadboat.com>
2016-08-08 14:10 pgsql: Obstruct shell, SQL, and conninfo injection via database and rol Noah Misch <noah@leadboat.com>
2016-08-08 14:10 pgsql: Obstruct shell, SQL, and conninfo injection via database and rol Noah Misch <noah@leadboat.com>
2016-08-08 14:10 pgsql: Obstruct shell, SQL, and conninfo injection via database and rol Noah Misch <noah@leadboat.com>
2016-08-08 14:10 pgsql: Obstruct shell, SQL, and conninfo injection via database and rol Noah Misch <noah@leadboat.com>
2016-08-08 14:10 pgsql: Obstruct shell, SQL, and conninfo injection via database and rol 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