pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kyle <kyle@actarg.com>
To: pgsql-sql@postgresql.org
Subject: RI permission problem
Date: Wed, 25 Apr 2001 09:57:03 -0600
Message-ID: <3AE6F3CF.BE4F1C72@actarg.com> (raw)

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

Attachments:

kyle.vcf (text/x-vcard, 184B) download 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

view thread (8+ messages)  latest in thread

Message-ID: <3AE6F3CF.BE4F1C72@actarg.com>
Permalink:  ../3AE6F3CF.BE4F1C72@actarg.com/
Also on:    postgresql.org/message-id/3AE6F3CF.BE4F1C72@actarg.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: kyle@actarg.com
  Subject: Re: RI permission problem
  In-Reply-To: <3AE6F3CF.BE4F1C72@actarg.com>
  References: <3AE6F3CF.BE4F1C72@actarg.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox