postgresql/doc/src/sgml/ref
Noah Misch fea164a72a Shore up ADMIN OPTION restrictions.
Granting a role without ADMIN OPTION is supposed to prevent the grantee
from adding or removing members from the granted role.  Issuing SET ROLE
before the GRANT bypassed that, because the role itself had an implicit
right to add or remove members.  Plug that hole by recognizing that
implicit right only when the session user matches the current role.
Additionally, do not recognize it during a security-restricted operation
or during execution of a SECURITY DEFINER function.  The restriction on
SECURITY DEFINER is not security-critical.  However, it seems best for a
user testing his own SECURITY DEFINER function to see the same behavior
others will see.  Back-patch to 8.4 (all supported versions).

The SQL standards do not conflate roles and users as PostgreSQL does;
only SQL roles have members, and only SQL users initiate sessions.  An
application using PostgreSQL users and roles as SQL users and roles will
never attempt to grant membership in the role that is the session user,
so the implicit right to add or remove members will never arise.

The security impact was mostly that a role member could revoke access
from others, contrary to the wishes of his own grantor.  Unapproved role
member additions are less notable, because the member can still largely
achieve that by creating a view or a SECURITY DEFINER function.

Reviewed by Andres Freund and Tom Lane.  Reported, independently, by
Jonas Sundman and Noah Misch.

Security: CVE-2014-0060
2014-02-17 09:33:31 -05:00
..
abort.sgml doc: update wording of ineffective SET and ABORT commands 2013-12-02 12:51:58 -05:00
allfiles.sgml Add ALTER SYSTEM command to edit the server configuration file. 2013-12-18 23:42:44 +09:00
alter_aggregate.sgml Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
alter_collation.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_conversion.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_database.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_default_privileges.sgml Remove ALTER DEFAULT PRIVILEGES' requirement of schema CREATE permissions. 2013-06-09 15:26:40 -04:00
alter_domain.sgml Add support for renaming domain constraints 2012-04-03 08:11:51 +03:00
alter_event_trigger.sgml Syntax support and documentation for event triggers. 2012-07-18 10:16:16 -04:00
alter_extension.sgml Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
alter_foreign_data_wrapper.sgml Improve documentation about usage of FDW validator functions. 2013-10-28 10:28:35 -04:00
alter_foreign_table.sgml Allow default expressions to be attached to columns of foreign tables. 2013-03-12 17:37:07 -04:00
alter_function.sgml Make CREATE/ALTER FUNCTION support NOT LEAKPROOF. 2012-02-15 10:45:08 -05:00
alter_group.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_index.sgml ALTER <thing> [IF EXISTS] ... allows silent DDL if required, 2012-01-23 23:25:04 +00:00
alter_language.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
alter_large_object.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
alter_materialized_view.sgml Fix typo in docs for ALTER MATERIALIZED VIEW. 2013-03-07 11:39:36 -06:00
alter_opclass.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_operator.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_opfamily.sgml Add SP-GiST (space-partitioned GiST) index access method. 2011-12-17 16:42:30 -05:00
alter_role.sgml Add ALTER ROLE ALL SET command 2013-02-17 23:45:36 -05:00
alter_rule.sgml Add support for ALTER RULE ... RENAME TO. 2013-02-08 23:58:40 -05:00
alter_schema.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
alter_sequence.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_server.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_system.sgml Add ALTER SYSTEM command to edit the server configuration file. 2013-12-18 23:42:44 +09:00
alter_table.sgml Add the notion of REPLICA IDENTITY for a table. 2013-11-08 12:30:43 -05:00
alter_tablespace.sgml ALTER TABLESPACE ... MOVE ... OWNED BY 2014-01-23 23:52:40 -05:00
alter_trigger.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_tsconfig.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_tsdictionary.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_tsparser.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_tstemplate.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_type.sgml Documentation fix for ALTER TYPE .. RENAME 2013-05-27 11:12:54 -04:00
alter_user_mapping.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_user.sgml Add REPLICATION privilege for ROLEs 2010-12-29 11:05:03 +01:00
alter_view.sgml WITH CHECK OPTION support for auto-updatable VIEWs 2013-07-18 17:10:16 -04:00
analyze.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
begin.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
checkpoint.sgml Make the CHECKPOINT reference page more clear. 2011-10-18 20:14:51 -04:00
close.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
cluster.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
clusterdb.sgml Support multiple -t/--table arguments for more commands 2013-01-17 11:24:47 +01:00
comment.sgml Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
commit_prepared.sgml Add compatibility information for prepared transaction commands 2012-04-16 22:40:54 +03:00
commit.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
copy.sgml Remove stray | character 2013-07-05 16:21:08 +02:00
create_aggregate.sgml Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
create_cast.sgml Casts to or from a domain type are ignored; warn and document. 2012-04-24 09:20:53 -04:00
create_collation.sgml Make a code-cleanup pass over the collations patch. 2011-04-22 17:43:18 -04:00
create_conversion.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
create_database.sgml Fix permissions explanations in CREATE DATABASE and CREATE SCHEMA docs. 2012-10-04 13:41:01 -04:00
create_domain.sgml Add support for privileges on types 2011-12-20 00:05:19 +02:00
create_event_trigger.sgml doc: Arrange See Also links in more consistent order 2013-07-02 20:12:58 -04:00
create_extension.sgml Improve documentation about the relationship of extensions and schemas. 2013-04-04 22:37:25 -04:00
create_foreign_data_wrapper.sgml Improve documentation about usage of FDW validator functions. 2013-10-28 10:28:35 -04:00
create_foreign_table.sgml Allow default expressions to be attached to columns of foreign tables. 2013-03-12 17:37:07 -04:00
create_function.sgml docs: improve CREATE FUNCTION docs about language case and quoting 2014-02-13 17:07:05 -05:00
create_group.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_index.sgml docs: add mention of index swapping 2014-01-30 12:14:24 -05:00
create_language.sgml Remove ancient downcasing code from procedural language operations. 2011-11-17 14:25:18 -05:00
create_materialized_view.sgml Switch user ID to the object owner when populating a materialized view. 2013-07-12 18:21:22 -04:00
create_opclass.sgml Add SP-GiST (space-partitioned GiST) index access method. 2011-12-17 16:42:30 -05:00
create_operator.sgml Add support for privileges on types 2011-12-20 00:05:19 +02:00
create_opfamily.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_role.sgml Make superuser imply replication privilege. The idea of a privilege that 2012-01-14 18:22:16 +02:00
create_rule.sgml Add support for ALTER RULE ... RENAME TO. 2013-02-08 23:58:40 -05:00
create_schema.sgml Fix permissions explanations in CREATE DATABASE and CREATE SCHEMA docs. 2012-10-04 13:41:01 -04:00
create_sequence.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_server.sgml Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
create_table_as.sgml Add a materialized view relations. 2013-03-03 18:23:31 -06:00
create_table.sgml Separate multixact freezing parameters from xid's 2014-02-13 19:36:31 -03:00
create_tablespace.sgml Add CREATE TABLESPACE ... WITH ... Options 2014-01-18 20:59:31 -05:00
create_trigger.sgml doc: Arrange See Also links in more consistent order 2013-07-02 20:12:58 -04:00
create_tsconfig.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_tsdictionary.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_tsparser.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_tstemplate.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_type.sgml Documentation spell checking and markup improvements 2013-05-20 21:13:13 -04:00
create_user_mapping.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
create_user.sgml Add REPLICATION privilege for ROLEs 2010-12-29 11:05:03 +01:00
create_view.sgml Allow only some columns of a view to be auto-updateable. 2013-10-18 10:35:36 -04:00
createdb.sgml doc: Fix for too many brackets in command synopses on man pages 2012-05-03 22:58:00 +03:00
createlang.sgml doc: Fix for too many brackets in command synopses on man pages 2012-05-03 22:58:00 +03:00
createuser.sgml Add a new option, -g, to createuser, to add membership in a role. 2013-12-11 07:50:36 -05:00
deallocate.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
declare.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
delete.sgml Provide adequate documentation of the "table_name *" notation. 2012-09-17 14:59:31 -04:00
discard.sgml Add DISCARD SEQUENCES command. 2013-10-03 16:23:31 -04:00
do.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_aggregate.sgml Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
drop_cast.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_collation.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_conversion.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_database.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_domain.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_event_trigger.sgml Syntax support and documentation for event triggers. 2012-07-18 10:16:16 -04:00
drop_extension.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_foreign_data_wrapper.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_foreign_table.sgml Remove whitespace from end of lines 2011-08-07 16:11:55 +03:00
drop_function.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_group.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
drop_index.sgml Fix assorted bugs in CREATE/DROP INDEX CONCURRENTLY. 2012-11-28 21:26:01 -05:00
drop_language.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_materialized_view.sgml Add a materialized view relations. 2013-03-03 18:23:31 -06:00
drop_opclass.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_operator.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_opfamily.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_owned.sgml DROP OWNED: don't try to drop tablespaces/databases 2013-01-28 18:40:51 -03:00
drop_role.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_rule.sgml Add support for ALTER RULE ... RENAME TO. 2013-02-08 23:58:40 -05:00
drop_schema.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_sequence.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_server.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_table.sgml Improve doc wording of drop table permission. 2011-10-15 10:08:02 -04:00
drop_tablespace.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_trigger.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_tsconfig.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_tsdictionary.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_tsparser.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_tstemplate.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_type.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_user_mapping.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_user.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
drop_view.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
dropdb.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
droplang.sgml doc: Fix for too many brackets in command synopses on man pages 2012-05-03 22:58:00 +03:00
dropuser.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
ecpg-ref.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
end.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
execute.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
explain.sgml Include planning time in EXPLAIN ANALYZE output. 2014-01-29 16:09:15 -05:00
fetch.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
grant.sgml Shore up ADMIN OPTION restrictions. 2014-02-17 09:33:31 -05:00
initdb.sgml Allow I/O reliability checks using 16-bit checksums 2013-03-22 13:54:07 +00:00
insert.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
listen.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
load.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
lock.sgml Documentation spell checking and markup improvements 2013-05-20 21:13:13 -04:00
move.sgml Duplicate expansion of "direction" from FETCH's synopsis into MOVE 2011-04-04 12:04:43 -04:00
notify.sgml Remove whitespace from end of lines 2013-05-30 21:05:07 -04:00
pg_basebackup.sgml Add --xlogdir option to pg_basebackup, for specifying the pg_xlog directory. 2013-11-27 14:00:16 +09:00
pg_config-ref.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
pg_controldata.sgml Some reference page improvements 2012-05-20 01:15:55 +03:00
pg_ctl-ref.sgml Revert "pg_ctl: Add idempotent option" 2013-04-29 21:55:12 -04:00
pg_dump.sgml Fix typos 2013-09-15 11:01:14 -04:00
pg_dumpall.sgml Add -d option to pg_dumpall, for specifying a connection string. 2013-02-25 19:39:10 +02:00
pg_isready.sgml doc: Fix some whitespace issues in the man pages 2013-05-13 21:59:39 -04:00
pg_receivexlog.sgml Fix typos in docs and comments. 2014-02-02 10:28:18 +09:00
pg_resetxlog.sgml Display old and new values in pg_resetxlog -n output. 2013-12-12 11:57:18 +02:00
pg_restore.sgml Accept multiple -I, -P, -T and -n options in pg_restore. 2013-08-28 09:43:34 +03:00
postgres-ref.sgml Clarify terminology standalone backend vs. single-user mode 2013-06-20 23:03:18 -04:00
postmaster.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
prepare_transaction.sgml Add compatibility information for prepared transaction commands 2012-04-16 22:40:54 +03:00
prepare.sgml Change plan caching to honor, not resist, changes in search_path. 2013-01-25 14:14:41 -05:00
psql-ref.sgml Suggest shell here-documents instead of psql -c for multiple commands. 2014-02-14 12:54:39 -05:00
reassign_owned.sgml REASSIGN OWNED: handle shared objects, too 2013-01-28 18:45:50 -03:00
refresh_materialized_view.sgml Add support for REFRESH MATERIALIZED VIEW CONCURRENTLY. 2013-07-16 12:55:44 -05:00
reindex.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
reindexdb.sgml Support multiple -t/--table arguments for more commands 2013-01-17 11:24:47 +01:00
release_savepoint.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
reset.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
revoke.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
rollback_prepared.sgml Add compatibility information for prepared transaction commands 2012-04-16 22:40:54 +03:00
rollback_to.sgml Some markup cleanup to deconfuse the find_gt_lt tool 2011-08-30 20:32:49 +03:00
rollback.sgml doc: update wording of ineffective SET and ABORT commands 2013-12-02 12:51:58 -05:00
savepoint.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
security_label.sgml Support ordered-set (WITHIN GROUP) aggregates. 2013-12-23 16:11:35 -05:00
select_into.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
select.sgml docs: specify FOR UPDATE/SHARE incompatibilities 2014-01-31 16:37:25 -05:00
set_constraints.sgml doc: update wording of ineffective SET and ABORT commands 2013-12-02 12:51:58 -05:00
set_role.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
set_session_auth.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
set_transaction.sgml doc: update wording of ineffective SET and ABORT commands 2013-12-02 12:51:58 -05:00
set.sgml doc: update wording of ineffective SET and ABORT commands 2013-12-02 12:51:58 -05:00
show.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
start_transaction.sgml Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
truncate.sgml Provide adequate documentation of the "table_name *" notation. 2012-09-17 14:59:31 -04:00
unlisten.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
update.sgml Provide adequate documentation of the "table_name *" notation. 2012-09-17 14:59:31 -04:00
vacuum.sgml Mention that VACUUM FREEZE also effectively zeroes the table freeze age. 2014-01-14 14:48:57 -05:00
vacuumdb.sgml Support multiple -t/--table arguments for more commands 2013-01-17 11:24:47 +01:00
values.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00