pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adrian Klaver <adrian.klaver@aklaver.com>
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 20:34:45 -0400
Message-ID: <716865.1649723685@sss.pgh.pa.us> (raw)
In-Reply-To: <50012a11-e91b-48d0-4944-b725d06624d6@aklaver.com>
References: <cfb9204f-5f46-5078-294b-a4a090f2bf7e@gmail.com>
	<50012a11-e91b-48d0-4944-b725d06624d6@aklaver.com>

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.

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <716865.1649723685@sss.pgh.pa.us>
Permalink:  ../716865.1649723685@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/716865.1649723685@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 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: tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com, robjsargent@gmail.com
  Subject: Re: How easy is it to lose permissions in 'public' schema?
  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>

* 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