pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Jan Wieck <wieck@debis.com>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: Foreign keys breaks tables permissions
Date: Fri, 19 May 2000 13:44:15 -0400
Message-ID: <8838.958758255@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.21.0005191309580.489-100000@localhost.localdomain>
References: <Pine.LNX.4.21.0005191309580.489-100000@localhost.localdomain>

Peter Eisentraut <peter_e@gmx.net> writes:
>> 1. Why is RI_FKey_check() using SELECT FOR UPDATE and not plain SELECT?
>> 2. What permissions should SELECT FOR UPDATE require?

> UPDATE seems reasonable. SELECT is no good because it would give read-only
> users the locking power of users with write access.

>> If the existing code is correct on both these points, then I think the
>> answer is that there is no bug: updating a table that has a foreign
>> key reference will require update rights on the master as well.

> I don't think that's acceptable.

I don't like it either, but if an FK check must use SELECT FOR UPDATE
then anyone who can trigger an FK check has the ability to create a
write-class lock on the referenced table.  Wrapping the FK check
in a SETUID trigger doesn't change that fundamental fact; it'll just
mean that the user triggering the check is now able to create a lock
that he doesn't have the privileges to create directly.

This is perhaps the least undesirable of the choices we have, but it's
still a security hole.

			regards, tom lane



view thread (13+ messages)  latest in thread

Message-ID: <8838.958758255@sss.pgh.pa.us>
Permalink:  ../8838.958758255@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8838.958758255@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, peter_e@gmx.net, wieck@debis.com, pgsql-hackers@postgresql.org
  Subject: Re: Foreign keys breaks tables permissions
  In-Reply-To: <8838.958758255@sss.pgh.pa.us>
  References: <Pine.LNX.4.21.0005191309580.489-100000@localhost.localdomain> <8838.958758255@sss.pgh.pa.us>

* 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