Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ne4Us-0004IY-Qt for pgsql-general@arkaria.postgresql.org; Tue, 12 Apr 2022 00:35:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ne4Uq-0004ms-E2 for pgsql-general@arkaria.postgresql.org; Tue, 12 Apr 2022 00:35:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ne4Uq-0004li-3F for pgsql-general@lists.postgresql.org; Tue, 12 Apr 2022 00:35:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ne4Uc-0007CK-QL for pgsql-general@lists.postgresql.org; Tue, 12 Apr 2022 00:35:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 23C0Yjbk716866; Mon, 11 Apr 2022 20:34:45 -0400 From: Tom Lane To: Adrian Klaver cc: Rob Sargent , "pgsql-generallists.postgresql.org" Subject: Re: How easy is it to lose permissions in 'public' schema? In-reply-to: <50012a11-e91b-48d0-4944-b725d06624d6@aklaver.com> References: <50012a11-e91b-48d0-4944-b725d06624d6@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Mon, 11 Apr 2022 17:28:06 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <716864.1649723685.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 11 Apr 2022 20:34:45 -0400 Message-ID: <716865.1649723685@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > On 4/11/22 16:10, Rob Sargent wrote: >> I've just bumped into this. >> = >> barnard=3D> select public.genome_threshold_mono('a'::text,'b'::text); >> ERROR:=C2=A0 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