Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint
Date: 2013-05-08 01:45:02
Message-ID: 9256.1367977502@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Greg Stark <stark(at)mit(dot)edu> writes:
> If we just reverted your fix and didn't fix it in 9.2 that would also
> fix the crash right? The bug was only that it leaked the fact that the
> view was provably empty from the definition?

Well, it might fail to report a permissions violation when the
not-allowed-to-be-accessed relation could be proven to yield no rows.
I agree that it's a bit hard to call that a security issue as long as
you assume that the attacker has access to the system catalogs; and
even if you don't assume that, being able to discern that there's a
check constraint on some table doesn't seem like a big leakage.

I had originally thought that the issue only occurred in 9.2, but it
turns out that the appendrel form of the problem occurs at least as far
back as 8.4; for example the following admittedly-artificial query

select * from
((select f1 as x from t1 offset 0)
union all
(select f2 as x from t2 offset 0)) ss
where false;

will not throw an error in any current release, even if the caller lacks
select privilege on t1 and/or t2. With manipulation of the outer WHERE
clause, you could find out about the nature of any check constraints on
t1/t2. It's easier to see the bug in 9.2 because you no longer need a
UNION ALL, but that doesn't much change the argument about whether it's
a security issue.

Given that forms of the bug have been around for a long time without
anyone noticing, it might be okay to leave it unfixed in the back
branches.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2013-05-08 09:24:38 Re: [COMMITTERS] pgsql: Fix permission tests for views/tables proven empty by constraint
Previous Message Peter Eisentraut 2013-05-08 01:24:33 pgsql: doc: Add IDs to link targets used by phpPgAdmin

Browse pgsql-hackers by date

  From Date Subject
Next Message KONDO Mitsumasa 2013-05-08 01:56:51 Re: Failing start-up archive recovery at Standby mode in PG9.2.4
Previous Message Peter Eisentraut 2013-05-08 01:27:04 Re: Make targets of doc links used by phpPgAdmin static