postgresql/src
Tom Lane 42ba393b59 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:04 +00:00
..
backend Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:04 +00:00
bin Translation updates 2009-12-08 22:22:17 +00:00
include Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:04 +00:00
interfaces Reject certificates with embedded NULLs in the commonName field. This stops 2009-12-09 06:37:29 +00:00
makefiles Allow out-of-tree builds on mingw and cygwin 2009-01-05 09:27:20 +00:00
pl Fix session-lifespan memory leak when a plperl function is redefined: 2009-11-29 21:02:22 +00:00
port Add inheritable ACE when creating a restricted token for execution on 2009-11-14 15:39:45 +00:00
template Tweak configure to attempt to add -qnoansialias to CFLAGS whenever running 2009-02-11 20:02:40 +00:00
test Add inheritable ACE when creating a restricted token for execution on 2009-11-14 15:39:45 +00:00
timezone Update time zone data files to tzdata release 2009s: DST law changes in 2009-12-09 00:35:59 +00:00
tools fsync test files 2009-09-21 20:21:02 +00:00
tutorial 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +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 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 Fix the makefiles to fail cleanly if Perl is needed but not present. This 2009-06-23 03:46:00 +00:00
Makefile.shlib Allow out-of-tree builds on mingw and cygwin 2009-01-05 09:27:20 +00: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