postgresql/src
Tom Lane e3b01bc1e1 Prevent indirect security attacks via changing session-local state within
an allegedly immutable index function.  It was previously recognized that
we had to prevent such a function from executing SET/RESET ROLE/SESSION
AUTHORIZATION, or it could trivially obtain the privileges of the session
user.  However, since there is in general no privilege checking for changes
of session-local state, it is also possible for such a function to change
settings in a way that might subvert later operations in the same session.
Examples include changing search_path to cause an unexpected function to
be called, or replacing an existing prepared statement with another one
that will execute a function of the attacker's choosing.

The present patch secures VACUUM, ANALYZE, and CREATE INDEX/REINDEX against
these threats, which are the same places previously deemed to need protection
against the SET ROLE issue.  GUC changes are still allowed, since there are
many useful cases for that, but we prevent security problems by forcing a
rollback of any GUC change after completing the operation.  Other cases are
handled by throwing an error if any change is attempted; these include temp
table creation, closing a cursor, and creating or deleting a prepared
statement.  (In 7.4, the infrastructure to roll back GUC changes doesn't
exist, so we settle for rejecting changes of "search_path" in these contexts.)

Original report and patch by Gurjeet Singh, additional analysis by
Tom Lane.

Security: CVE-2009-4136
2009-12-09 21:58:17 +00:00
..
backend Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:17 +00:00
bin Translation updates 2009-12-08 22:15:48 +00:00
include Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:17 +00:00
interfaces Reject certificates with embedded NULLs in the commonName field. This stops 2009-12-09 06:37:25 +00:00
makefiles Teach pgxs.mk and Install.pm how to install files from a contrib module 2007-10-16 16:00:00 +00:00
pl Fix session-lifespan memory leak when a plperl function is redefined: 2009-11-29 21:02:28 +00:00
port Add inheritable ACE when creating a restricted token for execution on 2009-11-14 15:39:41 +00:00
template Use SYSV semaphores rather than POSIX on Darwin >= 6.0 (i.e., OS X 10.2 2007-09-26 00:32:46 +00:00
test Add inheritable ACE when creating a restricted token for execution on 2009-11-14 15:39:41 +00:00
timezone Update time zone data files to tzdata release 2009s: DST law changes in 2009-12-09 00:36:08 +00:00
tools Enable the use of multiple CPUs/cores when building on MSVC. This only 2009-08-10 11:48:50 +00:00
tutorial Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00: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 Testing commit stuff 2006-07-10 15:50:02 +00:00
Makefile Tsearch2 functionality migrates to core. The bulk of this work is by 2007-08-21 01:11:32 +00:00
Makefile.global.in I find that an out-of-the-box installation of OSSP uuid 1.6.0 installs 2007-11-13 00:13:19 +00:00
Makefile.shlib Change $(CC) to $(COMPILER) on Solaris gcc so -m64 is passed into the 2007-02-20 22:45:57 +00:00
nls-global.mk When merging PO files, take into consideration translations in other PO 2006-04-05 13:40:15 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00