Re: security invoker review need full select (all columns) to do DML? - Mailing list pgsql-general

From Tom Lane
Subject Re: security invoker review need full select (all columns) to do DML?
Date
Msg-id 1777285.1724251184@sss.pgh.pa.us
Whole thread Raw
In response to Re: security invoker review need full select (all columns) to do DML?  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-general
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> The user must have select permissions on all columns selected by the
> subquery/view, because we don't go through the outer query to check
> which columns are actually referred to. Now maybe we could, but I
> suspect that would be quite a lot of effort because you'd need to be
> sure that the column wasn't referred to anywhere in either the outer
> query or the subquery itself (e.g., in WHERE clauses, etc.).

I'd argue that we should check that permission regardless, and are
probably required to by the SQL spec.  You don't normally get to
escape permission checks when bits of the query are optimized away.
(This is why permission checks are done on the range table not the
plan tree.)

            regards, tom lane



pgsql-general by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: security invoker review need full select (all columns) to do DML?
Next
From: Costa Alexoglou
Date:
Subject: Re: insufficient privilege with pg_read_all_stats granted