Received: from actarg.com (host25.actarg.com [209.180.91.25] (may be forged)) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3PFus370252 for ; Wed, 25 Apr 2001 11:56:54 -0400 (EDT) (envelope-from kyle@actarg.com) Received: from chi.actarg.com (IDENT:root@chi.actarg.com [192.168.2.16]) by actarg.com (8.9.3/8.9.3) with ESMTP id JAA02697 for ; Wed, 25 Apr 2001 09:56:50 -0600 Received: from actarg.com (IDENT:kyle@localhost [127.0.0.1]) by chi.actarg.com (8.9.3/8.9.3) with ESMTP id JAA06514 for ; Wed, 25 Apr 2001 09:57:03 -0600 Message-ID: <3AE6F3CF.BE4F1C72@actarg.com> Date: Wed, 25 Apr 2001 09:57:03 -0600 From: Kyle Organization: Action Target Inc. X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: RI permission problem Content-Type: multipart/mixed; boundary="------------F02609D58039EE1728540DB9" X-Archive-Number: 200104/378 X-Sequence-Number: 2736 This is a multi-part message in MIME format. --------------F02609D58039EE1728540DB9 Content-Type: multipart/alternative; boundary="------------0DBAABF4C4B849C6732418A3" --------------0DBAABF4C4B849C6732418A3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's an interesting security problem: Suppose I create two tables: create table a ( pk int4 primary key, aval text ); create table b ( fk int4 references a (pk) on update cascade, bval ); Then I grant a user update to table a but not to table b. He should be able to modify all the values in a freely, including the primary key (in practice it is an invoice number that often gets entered incorrectly and must be corrected.) But the user should not have update privilege to table b (most particularly, bval is privileged). But I would like the user to be able to update the primary key and hence cascade the update to table b. Is there a way to get this to work without granting update to table b? Tom, I understand someone was working on setuid functions. Is that a long way off? It would be nifty if triggers could execute with the privileges of the user that created them rather than the user who is executing them. This would help greatly in closing some security holes like this we are dealing with. Kyle Bateman --------------0DBAABF4C4B849C6732418A3 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Here's an interesting security problem:  Suppose I create two tables:

create table a (
   pk    int4 primary key,
   aval    text
);

create table b (
    fk    int4 references a (pk) on update cascade,
    bval
);

Then I grant a user update to table a but not to table b.  He should be able to modify all the values in a freely, including the primary key (in practice it is an invoice number that often gets entered incorrectly and must be corrected.)

But the user should not have update privilege to table b (most particularly, bval is privileged).  But I would like the user to be able to update the primary key and hence cascade the update to table b.

Is there a way to get this to work without granting update to table b?

Tom, I understand someone was working on setuid functions.  Is that a long way off?  It would be nifty if triggers could execute with the privileges of the user that created them rather than the user who is executing them.  This would help greatly in closing some security holes like this we are dealing with.

Kyle Bateman
  --------------0DBAABF4C4B849C6732418A3-- --------------F02609D58039EE1728540DB9 Content-Type: text/x-vcard; charset=us-ascii; name="kyle.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Kyle Content-Disposition: attachment; filename="kyle.vcf" begin:vcard n:Bateman;Kyle x-mozilla-html:FALSE org:Action Target Inc. adr:;;;;;; version:2.1 email;internet:kyle@actarg.com title:President x-mozilla-cpt:;0 fn:Kyle Bateman end:vcard --------------F02609D58039EE1728540DB9--