From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: Converting contrib SQL functions to new style
Date: Wed, 14 Apr 2021 14:03:56 -0400
Message-ID: <3567049.1618423436@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmobdzZc2UET6z_=e_Uia63Btb3jMX2bVSukWvE21y75o-g@mail.gmail.com>
References: <3395418.1618352794@sss.pgh.pa.us>
<20210414020827.GA1232417@rfd.leadboat.com>
<3441172.1618369873@sss.pgh.pa.us>
<20210414125811.GB1263822@rfd.leadboat.com>
<CA+TgmoaF_DKSPRnbkakkOufWMFpOBsA8fwE-mF0fF7aeH20zqg@mail.gmail.com>
<3489827.1618411777@sss.pgh.pa.us>
<CA+TgmoYQB1qxb=v9xVi09-f_HRDDqwUwfcuNpsZ2SF-ePpWJcw@mail.gmail.com>
<3566011.1618422104@sss.pgh.pa.us>
<CA+TgmobdzZc2UET6z_=e_Uia63Btb3jMX2bVSukWvE21y75o-g@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Apr 14, 2021 at 1:41 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Could we hack things so that extension scripts are only allowed to
>> reference objects created (a) by the system, (b) earlier in the
>> same script, or (c) owned by one of the declared prerequisite
>> extensions? Seems like that might provide a pretty bulletproof
>> defense against trojan-horse objects, though I'm not sure how much
>> of a pain it'd be to implement.
> That doesn't seem like a crazy idea, but the previous idea of having
> some magic syntax that means "the schema where extension FOO is" seems
> like it might be easier to implement and more generally useful.
I think that's definitely useful, but it's not a fix for the
reference-capture problem unless you care to assume that the other
extension's schema is free of trojan-horse objects. So I'm thinking
that we really ought to pursue both ideas.
This may mean that squeezing these contrib changes into v14 is a lost
cause. We certainly shouldn't try to do what I suggest above for
v14; but without it, these changes are just moving the security
issue to a different place rather than eradicating it completely.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, noah@leadboat.com, pgsql-hackers@lists.postgresql.org, peter.eisentraut@enterprisedb.com
Subject: Re: Converting contrib SQL functions to new style
In-Reply-To: <3567049.1618423436@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