From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Rob Sargent <robjsargent@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: How easy is it to lose permissions in 'public' schema?
Date: Mon, 11 Apr 2022 17:51:27 -0700
Message-ID: <d81bd77e-be7f-0b53-1089-882ce2edf0ac@aklaver.com> (raw)
In-Reply-To: <716865.1649723685@sss.pgh.pa.us>
References: <cfb9204f-5f46-5078-294b-a4a090f2bf7e@gmail.com>
<50012a11-e91b-48d0-4944-b725d06624d6@aklaver.com>
<716865.1649723685@sss.pgh.pa.us>
On 4/11/22 17:34, Tom Lane wrote:
> Adrian Klaver <adrian.klaver@aklaver.com> writes:
>> On 4/11/22 16:10, Rob Sargent wrote:
>>> I've just bumped into this.
>>>
>>> barnard=> select public.genome_threshold_mono('a'::text,'b'::text);
>>> ERROR: permission denied for schema public
>>> LINE 1: select public.genome_threshold_mono('a'::text,'b'::text);
>>>
>>> I know I haven't intentionally removed 'public' from grantee's purview
>>> and short of the code block above not actually getting run, any guesses
>>> as to how access to 'public' got removed from grantee?
>
>> I'm going to say someone read this:
>> https://wiki.postgresql.org/wiki/A_Guide_to_CVE-2018-1058:_Protect_Your_Search_Path
>> And did something along the line of this:
>> REVOKE CREATE ON SCHEMA public FROM PUBLIC;
>
> Note that that only recommends removing CREATE, though, not USAGE
> which is what Rob seems to be lacking.
Yeah that is why I threw in the 'And did something along the line of
this' and the 'Probably should take a look at what permissions the
functions in public have?'. I'm guessing someone saw the release notes
for 10.3(https://www.postgresql.org/docs/10/release-10-3.html) and the
comments on the mailing list and got proactive.
>
> regards, tom lane
--
Adrian Klaver
adrian.klaver@aklaver.com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, tgl@sss.pgh.pa.us, robjsargent@gmail.com
Subject: Re: How easy is it to lose permissions in 'public' schema?
In-Reply-To: <d81bd77e-be7f-0b53-1089-882ce2edf0ac@aklaver.com>
References: <cfb9204f-5f46-5078-294b-a4a090f2bf7e@gmail.com> <50012a11-e91b-48d0-4944-b725d06624d6@aklaver.com> <716865.1649723685@sss.pgh.pa.us> <d81bd77e-be7f-0b53-1089-882ce2edf0ac@aklaver.com>
* 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