postgresql/src
Tom Lane ab4bbf941f 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:30 +00:00
..
backend Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:30 +00:00
bin Translation updates 2009-12-08 22:13:05 +00:00
include Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:30 +00:00
interfaces Reject certificates with embedded NULLs in the commonName field. This stops 2009-12-09 06:37:21 +00:00
makefiles Add $(CFLAGS) to the simplified build rule for .so libraries on Darwin. 2006-11-28 05:45:43 +00:00
pl Fix session-lifespan memory leak when a plperl function is redefined: 2009-11-29 21:02:34 +00:00
port Revert backpatch of inheritable-ACE patch for Win32, since it broke 2009-11-20 01:28:18 +00:00
template Make --with-ldap build on Unixware, per Olivier Prenant. 2006-12-14 21:50:07 +00:00
test Fix the handling of sub-SELECTs appearing in the arguments of an outer-level 2009-04-25 16:45:12 +00:00
timezone Update time zone data files to tzdata release 2009s: DST law changes in 2009-12-09 00:36:18 +00:00
tools Enable the use of multiple CPUs/cores when building on MSVC. This only 2009-08-10 11:48:48 +00:00
tutorial
bcc32.mak
DEVELOPERS
Makefile
Makefile.global.in
Makefile.shlib
nls-global.mk
win32.mak