<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 8, 2021 at 4:27 PM Christoph Berg <<a href="mailto:myon@debian.org">myon@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Re: Raúl Marín<br>
> Are there any requirements to be a "trusted extension"? As in DO and DON'T<br>
> we should take into account during development in the future? I couldn't<br>
> find anything in Postgresql docs.<br>
<br>
There must not be any functions that you wouldn't want an untrusted<br>
user to execute, like modify system catalogs, or read/write directly<br>
from/to the filesystem. Extension install/upgrade scripts need to be<br>
secure against search_path attacks and similar.<br>
<br>
<a href="https://www.postgresql.org/docs/13/extend-extensions.html#EXTEND-EXTENSIONS-SECURITY" rel="noreferrer" target="_blank">https://www.postgresql.org/docs/13/extend-extensions.html#EXTEND-EXTENSIONS-SECURITY</a><br>
<br></blockquote><div><br></div><div>so, -1 as simple marking of extension.</div><div><br></div><div>+1 on below plan:<br></div><div><br></div><div>Our upgrade mechanism is not compliant with this. We need to drop upgrades from unpackaged to be marked as trusted at very least. <br><br></div><div>So the plan to mark postgis trusted will be at least:<br><br></div><div> - Announce that 3.2 is the last version to support upgrades from non-extension.</div><div> - Harden upgrades from earlier versions so that there is no chance to sneak in a function.</div><div> - Alternatively: forbid non-superuser to upgrade from pre-3.2.</div><div> - Get rid of all catalog trickery (needs core postgres team support to put all the ALTERs in place).</div><div><span style=""> - Release 3.2.</span><br></div><div> - Really get rid of all catalog trickery (needs PG14+ as we don't have all ALTERs in place yet in  PG13).<br></div><div> - Mark extension as trusted.</div><div> - Release 3.3.</div><div><br></div><div> </div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Darafei "Komяpa" Praliaskouski<br>OSM BY Team - <a href="http://openstreetmap.by/" target="_blank">http://openstreetmap.by/</a><br></div></div></div>