postgresql/src/include
Tom Lane 62aba76568 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:57:51 +00:00
..
access Fix an old bug in multixact and two-phase commit. Prepared transactions can 2009-11-23 09:58:36 +00:00
bootstrap Simplify the bootstrap (BKI) code by getting rid of a useless table of all 2009-09-27 01:32:11 +00:00
catalog Add exclusion constraints, which generalize the concept of uniqueness to 2009-12-07 05:22:23 +00:00
commands Add exclusion constraints, which generalize the concept of uniqueness to 2009-12-07 05:22:23 +00:00
executor Add exclusion constraints, which generalize the concept of uniqueness to 2009-12-07 05:22:23 +00:00
foreign 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
lib Assorted minor refactoring in EXPLAIN. 2009-07-24 21:08:42 +00:00
libpq Support "samehost" and "samenet" specifications in pg_hba.conf, 2009-10-01 01:58:58 +00:00
mb Write to the Windows eventlog in UTF16, converting the message encoding 2009-10-17 00:24:51 +00:00
nodes Add exclusion constraints, which generalize the concept of uniqueness to 2009-12-07 05:22:23 +00:00
optimizer Eliminate a lot of list-management overhead within join_search_one_level 2009-11-28 00:46:19 +00:00
parser Add exclusion constraints, which generalize the concept of uniqueness to 2009-12-07 05:22:23 +00:00
port Change our WIN32 API version to be 5.01 (Windows XP), to bring in the proper 2009-09-07 11:22:12 +00:00
portability 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
postmaster Add a boolean GUC parameter "bonjour" to control whether a Bonjour-enabled 2009-09-08 17:08:36 +00:00
regex Teach the regular expression functions to do case-insensitive matching and 2009-12-01 21:00:24 +00:00
rewrite Fix AcquireRewriteLocks to be sure that it acquires the right lock strength 2009-10-28 17:36:50 +00:00
snowball Update copyright for 2009. 2009-01-01 17:24:05 +00:00
storage Change the autovacuum launcher to read pg_database directly, rather than 2009-08-31 19:41:00 +00:00
tcop Revert due to Tom's concerns: 2009-12-01 02:31:13 +00:00
tsearch Introduce filtering dictionary support to tsearch. Propagate --nolocale option 2009-08-18 10:30:41 +00:00
utils Prevent indirect security attacks via changing session-local state within 2009-12-09 21:57:51 +00:00
c.h 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
fmgr.h Update copyright for 2009. 2009-01-01 17:24:05 +00:00
funcapi.h Support use of function argument names to identify which actual arguments 2009-10-08 02:39:25 +00:00
getaddrinfo.h Update copyright for 2009. 2009-01-01 17:24:05 +00:00
getopt_long.h Remove a boatload of useless definitions of 'int optreset'. If we 2009-04-05 04:19:59 +00:00
Makefile Update of install-sh, mkinstalldirs, and associated configury 2009-08-26 22:24:44 +00:00
miscadmin.h Prevent indirect security attacks via changing session-local state within 2009-12-09 21:57:51 +00:00
pg_config.h.in Support "samehost" and "samenet" specifications in pg_hba.conf, 2009-10-01 01:58:58 +00:00
pg_config.h.win32 Write psql's ~/.psql_history file using history_truncate_file() and 2009-09-13 22:18:22 +00:00
pg_config_manual.h 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
pg_trace.h Update copyright for 2009. 2009-01-01 17:24:05 +00:00
pgstat.h Add support for an application_name parameter, which is displayed in 2009-11-28 23:38:08 +00:00
pgtime.h Update copyright for 2009. 2009-01-01 17:24:05 +00:00
port.h Add inheritable ACE when creating a restricted token for execution on 2009-11-14 15:39:36 +00:00
postgres.h Update copyright for 2009. 2009-01-01 17:24:05 +00:00
postgres_ext.h Move NAMEDATALEN definition from postgres_ext.h to pg_config_manual.h. It 2007-02-06 09:16:08 +00:00
postgres_fe.h Update copyright for 2009. 2009-01-01 17:24:05 +00:00
rusagestub.h Update copyright for 2009. 2009-01-01 17:24:05 +00:00
windowapi.h 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00