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 1ne4kr-0005LL-7t for pgsql-general@arkaria.postgresql.org; Tue, 12 Apr 2022 00:51:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ne4kq-0004fx-33 for pgsql-general@arkaria.postgresql.org; Tue, 12 Apr 2022 00:51:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ne4kp-0004e5-Np for pgsql-general@lists.postgresql.org; Tue, 12 Apr 2022 00:51:35 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ne4kj-0007U7-9b for pgsql-general@lists.postgresql.org; Tue, 12 Apr 2022 00:51:34 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id BE1CF5C01DC; Mon, 11 Apr 2022 20:51:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 11 Apr 2022 20:51:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1649724688; x= 1649811088; bh=wt4l/hn5GVOAFRm1sXO38a8q7hA4z+mdSunbOiNXOtU=; b=u x0pmQMSfNUY3FQg8sVKWzTr8qP+JArJVpsuA8vPTUzH4yLHtklcZjdaYlq1qlt1P PikTM8543j2qcbqiokXECG0YzU0O9iGlPDKfaqKx4ovz5N33FeJjwpoChAMp5i2v RgfrYim1vGbSV/y6Ut5kXjTiBYsVQIA+kO1Z77dz+g4ZQ02uTiwtD0keQ9oTr8uC 8stz197ON2iz9o+yCDHi29QmkaiT2TnFWRiyHQXspdAovDcgAsiQ3N03r25zkV/V xRLmfn7Qh8vGjl9K/t4Oc7/Dea2YzLrY1cKqk+aVxRooxyu36TuQFZSp/FeHg7Dv cWCgXQm2p+flVC+w4TRdg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1649724688; x=1649811088; bh=wt4l/hn5GVOAF Rm1sXO38a8q7hA4z+mdSunbOiNXOtU=; b=A/VCP1rKIjRbsalS6GovNQl3KEX4T aGeVNvH1zciouZke2N3saEDb4Y+Lz8mqI0z6J5NJFm6bezyCAIxV8NkuMsDgelmJ EVH5sMfkxnxJ7aXdJCk9nwI3aYFZes0RRLM/IFaViUkO4/nuZIDUxtwwz4q4ZQix skGcljrtioIGthVR4KFYCA66Huot6/obsM2ph6ixHsNYTBgGYuN+6a9wlRolClbf GkVXv6NJzHnq/WAV71hHzOCxpF6ejra4/SB4KH9JvBqMgkHuuDxHfu4l3cqnnmBR hHHCBJRqLCUC69yLvqK21ijAp+uqWXH9VNCd6gzWNR2cU41kUaKr+YwOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekjedgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeelkeegjefhkeetheefudevteehiedvudehkeduleet fedvffeuhedtvdegtdeffeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Apr 2022 20:51:28 -0400 (EDT) Message-ID: Date: Mon, 11 Apr 2022 17:51:27 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: How easy is it to lose permissions in 'public' schema? Content-Language: en-US To: Tom Lane Cc: Rob Sargent , "pgsql-generallists.postgresql.org" References: <50012a11-e91b-48d0-4944-b725d06624d6@aklaver.com> <716865.1649723685@sss.pgh.pa.us> From: Adrian Klaver In-Reply-To: <716865.1649723685@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/11/22 17:34, Tom Lane wrote: > Adrian Klaver 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