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 1pFQD0-0004RU-Ss for pgsql-committers@arkaria.postgresql.org; Wed, 11 Jan 2023 01:47:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pFQCx-0005Wg-Ot for pgsql-committers@arkaria.postgresql.org; Wed, 11 Jan 2023 01:47:15 +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 1pFQCx-0005WX-I5 for pgsql-committers@lists.postgresql.org; Wed, 11 Jan 2023 01:47:15 +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 1pFQCu-0006Zj-AL; Wed, 11 Jan 2023 01:47:14 +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 30B1lADf399119; Tue, 10 Jan 2023 20:47:10 -0500 From: Tom Lane To: Robert Haas cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Add new GUC createrole_self_grant. In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Tue, 10 Jan 2023 17:46:00 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <399117.1673401630.1@sss.pgh.pa.us> Date: Tue, 10 Jan 2023 20:47:10 -0500 Message-ID: <399118.1673401630@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > Add new GUC createrole_self_grant. > Can be set to the empty string, or to either or both of "set" or > "inherit". If set to a non-empty value, a non-superuser who creates > a role (necessarily by relying up the CREATEROLE privilege) will > grant that role back to themselves with the specified options. > This isn't a security feature, because the grant that this feature > triggers can also be performed explicitly. [ squint ... ] Are you sure it's not a security *hazard*, though? It troubles me that we're introducing a command-semantics-altering GUC at all; we have substantial experience with regretting such choices. It troubles me more that the semantics change bears on security matters, and even more that you've made it USERSET. That at least opens the door to unprivileged user X causing code belonging to more-privileged user Y to do something other than what Y expected. I'll hold my tongue if you're willing to make it SUSET or higher. regards, tom lane