pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add security checks to selectivity estimation functions
6+ messages / 1 participants
[nested] [flat]

* pgsql: Add security checks to selectivity estimation functions
@ 2017-05-08 13:32  Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2017-05-08 13:32 UTC (permalink / raw)
  To: pgsql-committers

Add security checks to selectivity estimation functions

Some selectivity estimation functions run user-supplied operators over
data obtained from pg_statistic without security checks, which allows
those operators to leak pg_statistic data without having privileges on
the underlying tables.  Fix by checking that one of the following is
satisfied: (1) the user has table or column privileges on the table
underlying the pg_statistic data, or (2) the function implementing the
user-supplied operator is leak-proof.  If neither is satisfied, planning
will proceed as if there are no statistics available.

At least one of these is satisfied in most cases in practice.  The only
situations that are negatively impacted are user-defined or
not-leak-proof operators on a security-barrier view.

Reported-by: Robert Haas <robertmhaas@gmail.com>
Author: Peter Eisentraut <peter_e@gmx.net>
Author: Tom Lane <tgl@sss.pgh.pa.us>

Security: CVE-2017-7484

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d45cd7c0edb5364c525f2128c837850c93138b27

Modified Files
--------------
doc/src/sgml/planstats.sgml                 |  60 +++++++++++
src/backend/utils/adt/array_selfuncs.c      |   6 +-
src/backend/utils/adt/rangetypes_selfuncs.c |  22 ++++
src/backend/utils/adt/selfuncs.c            | 160 ++++++++++++++++++++++------
src/include/utils/selfuncs.h                |   2 +
src/test/regress/expected/privileges.out    |  97 +++++++++++++++++
src/test/regress/sql/privileges.sql         |  61 +++++++++++
7 files changed, 376 insertions(+), 32 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: Add security checks to selectivity estimation functions
@ 2017-05-08 13:32  Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2017-05-08 13:32 UTC (permalink / raw)
  To: pgsql-committers

Add security checks to selectivity estimation functions

Some selectivity estimation functions run user-supplied operators over
data obtained from pg_statistic without security checks, which allows
those operators to leak pg_statistic data without having privileges on
the underlying tables.  Fix by checking that one of the following is
satisfied: (1) the user has table or column privileges on the table
underlying the pg_statistic data, or (2) the function implementing the
user-supplied operator is leak-proof.  If neither is satisfied, planning
will proceed as if there are no statistics available.

At least one of these is satisfied in most cases in practice.  The only
situations that are negatively impacted are user-defined or
not-leak-proof operators on a security-barrier view.

Reported-by: Robert Haas <robertmhaas@gmail.com>
Author: Peter Eisentraut <peter_e@gmx.net>
Author: Tom Lane <tgl@sss.pgh.pa.us>

Security: CVE-2017-7484

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c33c42362256382ed398df9dcda559cd547c68a7

Modified Files
--------------
doc/src/sgml/planstats.sgml                 |  60 +++++++++++
src/backend/utils/adt/array_selfuncs.c      |   6 +-
src/backend/utils/adt/rangetypes_selfuncs.c |  22 ++++
src/backend/utils/adt/selfuncs.c            | 160 ++++++++++++++++++++++------
src/include/utils/selfuncs.h                |   2 +
src/test/regress/expected/privileges.out    |  97 +++++++++++++++++
src/test/regress/sql/privileges.sql         |  61 +++++++++++
7 files changed, 376 insertions(+), 32 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: Add security checks to selectivity estimation functions
@ 2017-05-08 13:32  Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2017-05-08 13:32 UTC (permalink / raw)
  To: pgsql-committers

Add security checks to selectivity estimation functions

Some selectivity estimation functions run user-supplied operators over
data obtained from pg_statistic without security checks, which allows
those operators to leak pg_statistic data without having privileges on
the underlying tables.  Fix by checking that one of the following is
satisfied: (1) the user has table or column privileges on the table
underlying the pg_statistic data, or (2) the function implementing the
user-supplied operator is leak-proof.  If neither is satisfied, planning
will proceed as if there are no statistics available.

At least one of these is satisfied in most cases in practice.  The only
situations that are negatively impacted are user-defined or
not-leak-proof operators on a security-barrier view.

Reported-by: Robert Haas <robertmhaas@gmail.com>
Author: Peter Eisentraut <peter_e@gmx.net>
Author: Tom Lane <tgl@sss.pgh.pa.us>

Security: CVE-2017-7484

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e2d4ef8de869c57e3bf270a30c12d48c2ce4e00c

Modified Files
--------------
doc/src/sgml/planstats.sgml                 |  61 +++++++++++
src/backend/utils/adt/array_selfuncs.c      |   6 +-
src/backend/utils/adt/rangetypes_selfuncs.c |  22 ++++
src/backend/utils/adt/selfuncs.c            | 160 ++++++++++++++++++++++------
src/include/utils/selfuncs.h                |   2 +
src/test/regress/expected/privileges.out    |  97 +++++++++++++++++
src/test/regress/sql/privileges.sql         |  61 +++++++++++
7 files changed, 377 insertions(+), 32 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: Add security checks to selectivity estimation functions
@ 2017-05-08 13:32  Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2017-05-08 13:32 UTC (permalink / raw)
  To: pgsql-committers

Add security checks to selectivity estimation functions

Some selectivity estimation functions run user-supplied operators over
data obtained from pg_statistic without security checks, which allows
those operators to leak pg_statistic data without having privileges on
the underlying tables.  Fix by checking that one of the following is
satisfied: (1) the user has table or column privileges on the table
underlying the pg_statistic data, or (2) the function implementing the
user-supplied operator is leak-proof.  If neither is satisfied, planning
will proceed as if there are no statistics available.

At least one of these is satisfied in most cases in practice.  The only
situations that are negatively impacted are user-defined or
not-leak-proof operators on a security-barrier view.

Reported-by: Robert Haas <robertmhaas@gmail.com>
Author: Peter Eisentraut <peter_e@gmx.net>
Author: Tom Lane <tgl@sss.pgh.pa.us>

Security: CVE-2017-7484

Branch
------
REL9_2_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d035c1b970fe948c10773315a2f022204bc45df6

Modified Files
--------------
doc/src/sgml/planstats.sgml              |  60 ++++++++++++
src/backend/utils/adt/array_selfuncs.c   |   6 +-
src/backend/utils/adt/selfuncs.c         | 160 +++++++++++++++++++++++++------
src/include/utils/selfuncs.h             |   2 +
src/test/regress/expected/privileges.out |  97 +++++++++++++++++++
src/test/regress/sql/privileges.sql      |  61 ++++++++++++
6 files changed, 354 insertions(+), 32 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: Add security checks to selectivity estimation functions
@ 2017-05-08 13:32  Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2017-05-08 13:32 UTC (permalink / raw)
  To: pgsql-committers

Add security checks to selectivity estimation functions

Some selectivity estimation functions run user-supplied operators over
data obtained from pg_statistic without security checks, which allows
those operators to leak pg_statistic data without having privileges on
the underlying tables.  Fix by checking that one of the following is
satisfied: (1) the user has table or column privileges on the table
underlying the pg_statistic data, or (2) the function implementing the
user-supplied operator is leak-proof.  If neither is satisfied, planning
will proceed as if there are no statistics available.

At least one of these is satisfied in most cases in practice.  The only
situations that are negatively impacted are user-defined or
not-leak-proof operators on a security-barrier view.

Reported-by: Robert Haas <robertmhaas@gmail.com>
Author: Peter Eisentraut <peter_e@gmx.net>
Author: Tom Lane <tgl@sss.pgh.pa.us>

Security: CVE-2017-7484

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4f1b2089a1b8f82cbd28b4cd8d0e1e9f1486d2b6

Modified Files
--------------
doc/src/sgml/planstats.sgml                 |  60 +++++++++++
src/backend/utils/adt/array_selfuncs.c      |   6 +-
src/backend/utils/adt/rangetypes_selfuncs.c |  22 ++++
src/backend/utils/adt/selfuncs.c            | 160 ++++++++++++++++++++++------
src/include/utils/selfuncs.h                |   2 +
src/test/regress/expected/privileges.out    |  97 +++++++++++++++++
src/test/regress/sql/privileges.sql         |  61 +++++++++++
7 files changed, 376 insertions(+), 32 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: Add security checks to selectivity estimation functions
@ 2017-05-08 13:32  Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2017-05-08 13:32 UTC (permalink / raw)
  To: pgsql-committers

Add security checks to selectivity estimation functions

Some selectivity estimation functions run user-supplied operators over
data obtained from pg_statistic without security checks, which allows
those operators to leak pg_statistic data without having privileges on
the underlying tables.  Fix by checking that one of the following is
satisfied: (1) the user has table or column privileges on the table
underlying the pg_statistic data, or (2) the function implementing the
user-supplied operator is leak-proof.  If neither is satisfied, planning
will proceed as if there are no statistics available.

At least one of these is satisfied in most cases in practice.  The only
situations that are negatively impacted are user-defined or
not-leak-proof operators on a security-barrier view.

Reported-by: Robert Haas <robertmhaas@gmail.com>
Author: Peter Eisentraut <peter_e@gmx.net>
Author: Tom Lane <tgl@sss.pgh.pa.us>

Security: CVE-2017-7484

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3e5ea1f9b21c94acce01d7a5bf5bfcf36e670b0a

Modified Files
--------------
doc/src/sgml/planstats.sgml                 |  60 +++++++++++
src/backend/utils/adt/array_selfuncs.c      |   6 +-
src/backend/utils/adt/rangetypes_selfuncs.c |  22 ++++
src/backend/utils/adt/selfuncs.c            | 160 ++++++++++++++++++++++------
src/include/utils/selfuncs.h                |   2 +
src/test/regress/expected/privileges.out    |  97 +++++++++++++++++
src/test/regress/sql/privileges.sql         |  61 +++++++++++
7 files changed, 376 insertions(+), 32 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:[~2017-05-08 13:32 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08 13:32 pgsql: Add security checks to selectivity estimation functions Peter Eisentraut <peter_e@gmx.net>
2017-05-08 13:32 pgsql: Add security checks to selectivity estimation functions Peter Eisentraut <peter_e@gmx.net>
2017-05-08 13:32 pgsql: Add security checks to selectivity estimation functions Peter Eisentraut <peter_e@gmx.net>
2017-05-08 13:32 pgsql: Add security checks to selectivity estimation functions Peter Eisentraut <peter_e@gmx.net>
2017-05-08 13:32 pgsql: Add security checks to selectivity estimation functions Peter Eisentraut <peter_e@gmx.net>
2017-05-08 13:32 pgsql: Add security checks to selectivity estimation functions Peter Eisentraut <peter_e@gmx.net>

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