From 993b3e50845134e863968bcdaf148ff3e576c74a Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Thu, 23 Feb 2012 15:39:14 -0500
Subject: 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
---
doc/src/sgml/ref/create_trigger.sgml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'doc/src')
diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml
index 8d7574319f9..ecb1f56cbfe 100644
--- a/doc/src/sgml/ref/create_trigger.sgml
+++ b/doc/src/sgml/ref/create_trigger.sgml
@@ -183,7 +183,8 @@ CREATE TRIGGER name { BEFORE | AFTE
To create a trigger on a table, the user must have the
- TRIGGER privilege on the table.
+ TRIGGER privilege on the table. The user must
+ also have EXECUTE privilege on the trigger function.
--
cgit v1.2.3