pgsql: Disallow RESET ROLE and RESET SESSION AUTHORIZATION inside

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Disallow RESET ROLE and RESET SESSION AUTHORIZATION inside
Date: 2009-09-03 22:08:05
Message-ID: 20090903220805.62E99753FB7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Disallow RESET ROLE and RESET SESSION AUTHORIZATION inside security-definer
functions.

This extends the previous patch that forbade SETting these variables inside
security-definer functions. RESET is equally a security hole, since it
would allow regaining privileges of the caller; furthermore it can trigger
Assert failures and perhaps other internal errors, since the code is not
expecting these variables to change in such contexts. The previous patch
did not cover this case because assign hooks don't really have enough
information, so move the responsibility for preventing this into guc.c.

Problem discovered by Heikki Linnakangas.

Security: no CVE assigned yet, extends CVE-2007-6600

Modified Files:
--------------
pgsql/src/backend/commands:
variable.c (r1.130 -> r1.131)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/variable.c?r1=1.130&r2=1.131)
pgsql/src/backend/utils/misc:
guc.c (r1.514 -> r1.515)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/guc.c?r1=1.514&r2=1.515)
pgsql/src/include/utils:
guc.h (r1.103 -> r1.104)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/guc.h?r1=1.103&r2=1.104)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-09-03 22:08:14 pgsql: Disallow RESET ROLE and RESET SESSION AUTHORIZATION inside
Previous Message Peter Eisentraut 2009-09-03 21:01:27 pgsql: Translation updates