Re: Extension security improvement: Add support for extensions with an owned schema - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Extension security improvement: Add support for extensions with an owned schema
Date
Msg-id 139657.1718819744@sss.pgh.pa.us
Whole thread Raw
In response to Re: Extension security improvement: Add support for extensions with an owned schema  (Jelte Fennema-Nio <me@jeltef.nl>)
Responses Re: Extension security improvement: Add support for extensions with an owned schema
List pgsql-hackers
Jelte Fennema-Nio <me@jeltef.nl> writes:
> On Wed, 19 Jun 2024 at 17:28, Robert Haas <robertmhaas@gmail.com> wrote:
>> I have a feeling that this might be pretty annoying to implement, and
>> if that is true, then never mind.

> Based on a quick look it's not trivial, but also not super bad.
> Basically it seems like in src/backend/catalog/namespace.c, every time
> we loop over activeSearchPath and CurrentExtensionObject is set, then
> we should skip any item that's not stored in pg_catalog, unless
> there's a DEPENDENCY_EXTENSION pg_depend entry for the item (and that
> pg_depend entry references the extension or the requires list).

We could change the lookup rules that apply during execution of
an extension script, but we already restrict search_path at that
time so I'm not sure how much further this'd move the goalposts.

The *real* problem IMO is that if you create a PL function or
(old-style) SQL function within an extension, execution of that
function is not similarly protected.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: Extension security improvement: Add support for extensions with an owned schema
Next
From: Peter Geoghegan
Date:
Subject: Re: Maybe don't process multi xmax in FreezeMultiXactId() if it is already marked as invalid?