postgresql/src
Noah Misch ff35425c8f 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:38 -05:00
..
backend Shore up ADMIN OPTION restrictions. 2014-02-17 09:33:38 -05:00
bin Clean up error cases in psql's COPY TO STDOUT/FROM STDIN code. 2014-02-13 18:45:32 -05:00
include Stamp 8.4.19. 2013-12-02 16:06:31 -05:00
interfaces Improve libpq's error recovery for connection loss during COPY. 2014-02-12 17:50:23 -05:00
makefiles Make pgxs build executables with the right suffix. 2013-01-19 14:54:29 -05:00
pl Eliminate memory leaks in plperl's spi_prepare() function. 2013-03-01 21:34:40 -05:00
port Add "SHIFT_JIS" as an accepted encoding name for locale checking. 2013-12-15 11:11:11 +09:00
template Tweak configure to attempt to add -qnoansialias to CFLAGS whenever running 2009-02-11 20:02:40 +00:00
test Shore up ADMIN OPTION restrictions. 2014-02-17 09:33:38 -05:00
timezone Ooops, forgot to remove solar87 and friends from src/timezone/Makefile. 2014-02-14 23:20:33 -05:00
tools Don't generate plain-text HISTORY and src/test/regress/README anymore. 2014-02-10 20:48:30 -05:00
tutorial Remove copyright mention of Andrew Yu, per author's permission. 2010-02-02 18:52:06 +00:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:08 +02:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Add the possibility to specify an explicit validator function for foreign-data 2009-02-24 10:06:36 +00:00
Makefile.global.in Back-patch creation of tar.bz2 tarball during "make dist". 2011-07-03 16:40:28 -04:00
Makefile.shlib Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:03:20 -04:00
nls-global.mk Do not msgmerge against /dev/null; merge against the pot file itself 2009-01-20 09:58:50 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00