pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jelte Fennema-Nio <me@jeltef.nl>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Extension security improvement: Add support for extensions with an owned schema
Date: Wed, 19 Jun 2024 13:55:44 -0400
Message-ID: <139657.1718819744@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGECzQSyznMQCPtrxn0FcnR3gS1pirt--Gw28to22Q+QMvDSVg@mail.gmail.com>
References: <CAGECzQQzDqDzakBkR71ZkQ1N1ffTjAaruRSqppQAKu3WF+6rNQ@mail.gmail.com>
	<CA+TgmoZEqpXGdzMNW99UGPhXa8TKu5eNCBu6doAu9T3ti3P1ow@mail.gmail.com>
	<CAGECzQSyznMQCPtrxn0FcnR3gS1pirt--Gw28to22Q+QMvDSVg@mail.gmail.com>

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





view thread (43+ messages)  latest in thread

Message-ID: <139657.1718819744@sss.pgh.pa.us>
Permalink:  ../139657.1718819744@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/139657.1718819744@sss.pgh.pa.us

 · 

reply

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, me@jeltef.nl, robertmhaas@gmail.com
  Subject: Re: Extension security improvement: Add support for extensions with an owned schema
  In-Reply-To: <139657.1718819744@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