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 1pFR3B-0001iM-EA for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jan 2023 02:41:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pFR2B-0007Ch-QG for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jan 2023 02:40:11 +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 1pFR2B-0007CX-Gx for pgsql-hackers@lists.postgresql.org; Wed, 11 Jan 2023 02:40:11 +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 1pFR29-00076T-GH for pgsql-hackers@postgresql.org; Wed, 11 Jan 2023 02:40:11 +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 30B2e78f404210; Tue, 10 Jan 2023 21:40:07 -0500 From: Tom Lane To: Robert Haas cc: "pgsql-hackers@postgresql.org" Subject: Re: pgsql: Add new GUC createrole_self_grant. In-reply-to: References: <399118.1673401630@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 10 Jan 2023 21:26:17 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <404208.1673404807.1@sss.pgh.pa.us> Date: Tue, 10 Jan 2023 21:40:07 -0500 Message-ID: <404209.1673404807@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Tue, Jan 10, 2023 at 8:47 PM Tom Lane wrote: >> [ squint ... ] Are you sure it's not a security *hazard*, though? > I think you have to squint pretty hard to find a security hazard here. Maybe, but I'd be sad if somebody manages to find one after this is out in the wild. > That said, in my original design, this was controlled via a different > mechanism which was superuser-only. I was informed that made no sense, > so I changed it. Now here we are. Yeah. I concur that a SUSET GUC isn't much fun for a non-superuser CREATEROLE holder who might wish to adjust the default behavior they get. I also concur that it seems a bit far-fetched that a CREATEROLE holder might create a SECURITY DEFINER function that would do something that would be affected by this setting. Still, we have no field experience with how these mechanisms will actually be used, so I'm worried. The scenario I'm worried about could be closed, mostly, if we were willing to invent an intermediate GUC privilege level "can be set interactively but only by CREATEROLE holders" ("PGC_CRSET"?). But that's an awful lot of infrastructure to add for one GUC. Are there any other GUCs where that'd be a more useful choice than any we have now? regards, tom lane