pgsql: Disallow RESET ROLE and RESET SESSION AUTHORIZATION inside - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Disallow RESET ROLE and RESET SESSION AUTHORIZATION inside
Date
Msg-id 20090903220805.62E99753FB7@cvs.postgresql.org
Whole thread Raw
List 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)

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: On Windows, when a file is deleted and another process still has
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Disallow RESET ROLE and RESET SESSION AUTHORIZATION inside