pgsql: Require execute permission on the trigger function for CREATE TR

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Require execute permission on the trigger function for CREATE TR
Date: 2012-02-23 23:04:45
Message-ID: E1S0hiP-00087e-RM@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Require execute permission on the trigger function for CREATE TRIGGER.

This check was overlooked when we added function execute permissions to the
system years ago. For an ordinary trigger function it's not a big deal,
since trigger functions execute with the permissions of the table owner,
so they couldn't do anything the user issuing the CREATE TRIGGER couldn't
have done anyway. However, if a trigger function is SECURITY DEFINER,
that is not the case. The lack of checking would allow another user to
install it on his own table and then invoke it with, essentially, forged
input data; which the trigger function is unlikely to realize, so it might
do something undesirable, for instance insert false entries in an audit log
table.

Reported by Dinesh Kumar, patch by Robert Haas

Security: CVE-2012-0866

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/891e6e7bfd9bb72687522af08c18689f795cb60a

Modified Files
--------------
doc/src/sgml/ref/create_trigger.sgml | 3 ++-
src/backend/commands/trigger.c | 11 +++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-02-23 23:04:46 pgsql: Stamp 9.1.3.
Previous Message Tom Lane 2012-02-23 20:05:37 pgsql: Allow MinGW builds to use standardly-named OpenSSL libraries.