Re: Row-Trigger implicitly allows users ACL_SELECT

From: KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Row-Trigger implicitly allows users ACL_SELECT
Date: 2009-03-12 13:39:01
Message-ID: 49B91075.2090704@kaigai.gr.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com> writes:
>> * Row-Update/Delete trigger mechanism allows user defined triggers
>> to refer the older tuple updated/deleted.
>> * The ACL_TRIGGER privilege allows normal users to set up triggers
>> on the relation allowed.
>
>> It means someone with ACL_TRIGGER can set up a trigger which write
>> out the given older tuple into somewhere.
>> In logically, it also means users with ACL_TRIGGER and either of
>> ACL_UPDATE or ACL_DELETE are allowed to read the table without
>> ACL_SELECT permission.
>
> Granting TRIGGER privilege already implies an exceedingly high trust
> level, since a trigger can do arbitrary damage to your data. I don't
> find this concern interesting, and your solution wouldn't work anyway
> (AFAICS it would check the permissions of the user doing the UPDATE,
> not those of the user who created the trigger).

I think we have two attitudes/options.
The one considers ACL_TRIGGER just as a privilege to create a trigger,
so we need to check when the backend delivers OLD/NEW into triggers,
as I noted today.
The other considers triggers are high trusted process and ACL_TRIGGER
privilege includes a right to set up such a trusted one, as you noted.

From the point of SE-PostgreSQL, it can accept either of them.
(If we take the later option, it will need db_procedure:{install}
checks (in the future revision), because of it means user defined
triggers installed as a part of system internal stuff.)

The current implementation adopt the former stance, but it may
be better to adopt the later one, in the sense of consistency.

Thanks,
--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2009-03-12 15:26:28 Re: Should SET ROLE inherit config params?
Previous Message Tom Lane 2009-03-12 12:45:36 Re: Row-Trigger implicitly allows users ACL_SELECT