Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1riGwa-00G6DY-DJ for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Mar 2024 16:50:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1riGwY-006zE7-F4 for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Mar 2024 16:50:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1riGwY-006zDx-62 for pgsql-hackers@lists.postgresql.org; Thu, 07 Mar 2024 16:50:06 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1riGwU-003LE4-Vd for pgsql-hackers@postgresql.org; Thu, 07 Mar 2024 16:50:05 +0000 Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7c8851aa815so33151739f.3 for ; Thu, 07 Mar 2024 08:50:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709830203; x=1710435003; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=g3zW7Mgl9siavtQhpFt6vn2RbnxAkuxIdM++na0d73o=; b=bFfyWQ0atvk2u30um4ojYlaCUkpBBbBZ246fE6QpR9LqMvVrxliMDyL26DgZU4FDKP yTzqh/Wv+zYGwohTHsS6RuzmigdoCkNYK/i8NgHPfLaYINVOkykQmdhIZqYv3gdB5Usx WAy+NRE3KxAWFNLOrzr/VRjny2U6PLkBjunb9iDJNn7N2fx3v0blLSN5uju4dxT7nCTi YbO74n7WmHxVeDuZnetGmeH69dPV6bTLBf9ZXRrCPcaqYPVJCP11yu2an3WehN9MoxWQ 8WRDa2fUToRMO4gRHx395qoaULoXdEZHgEKMS83jit26jj9aQZfxtTGfMWx3qDPvJhY/ K4ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709830203; x=1710435003; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=g3zW7Mgl9siavtQhpFt6vn2RbnxAkuxIdM++na0d73o=; b=qsxTCDxZgPxL4lskN1A8KKo1ZJnQMcq7ibiiiFow42CEGR/BdfaTMZkHWxwbvGSXQp A9udsu5WnFLPX73Z1e5PTMbH5b6qdrf7239BWPPe/b1PSd/yw7rkbEqh75U8wJdgBgMm DqsaFTVsx9eSnXpV7gl8C5i6z5j/Rwv6NtVzR4kBIeztm8qLi6MTDcptdA76cIb9HrvT cSF3i30UI2zd4FYXByxF0nL4IVwSIU5PW39MOcrKUiP2Oba5+2Q0QoJmzuacQbz4PMpj GmknMjc9pnTSYE81CKRuOxSI0/HfcaRGiec00oV8bFjeXLZ6XgKyfP9achn1EYxEavBJ kPug== X-Gm-Message-State: AOJu0YxqFlhG7CHrel3RsaT6E2hAu6F6zopdRQdaem4kwJ+iDW9H0d9o 30njAutwFrgBBeqgm25vPVDxvcKE+D6koAhI5TLBwZ6glrfiSSAHR7KeqfUS X-Google-Smtp-Source: AGHT+IEB33j9bRcRByq9iDeocLy72Xlvs9/OEB/Aya/2a3AImXqGDg9nUjJg9XdBeNRi3dt3Mb0jOg== X-Received: by 2002:a5d:8896:0:b0:7c8:32a6:387c with SMTP id d22-20020a5d8896000000b007c832a6387cmr17628776ioo.8.1709830203282; Thu, 07 Mar 2024 08:50:03 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id d9-20020a0566022be900b007c846141896sm1808743ioy.48.2024.03.07.08.50.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 08:50:03 -0800 (PST) Date: Thu, 7 Mar 2024 10:50:00 -0600 From: Nathan Bossart To: pgsql-hackers@postgresql.org Subject: Re: un-revert the MAINTAIN privilege and the pg_maintain predefined role Message-ID: <20240307165000.GA388645@nathanxps13> References: <20240305161235.GA3478007@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240305161235.GA3478007@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 05, 2024 at 10:12:35AM -0600, Nathan Bossart wrote: > Thanks to Jeff's recent work with commits 2af07e2 and 59825d1, the issue > that led to the revert of the MAINTAIN privilege and the pg_maintain > predefined role (commit 151c22d) should now be resolved. Specifically, > there was a concern that roles with the MAINTAIN privilege could use > search_path tricks to run arbitrary code as the table owner. Jeff's work > prevents this by restricting search_path to a known safe value when running > maintenance commands. (This approach and others were discussed on the > lists quite extensively, and it was also brought up at the developer > meeting at FOSDEM [0] earlier this year.) > > Given this, I'd like to finally propose un-reverting MAINTAIN and > pg_maintain. I created a commitfest entry for this [1] a few weeks ago and > attached it to Jeff's search_path thread, but I figured it would be good to > create a dedicated thread for this, too. The attached patch is a straight > revert of commit 151c22d except for the following small changes: > > * The catversion bump has been removed for now. The catversion will need > to be bumped appropriately if/when this is committed. > > * The OID for the pg_maintain predefined role needed to be changed. The > original OID has been reused for something else since this feature was > reverted. > > * The change in AdjustUpgrade.pm needed to be updated to check for > "$old_version < 17" instead of "$old_version < 16". Given all of this code was previously reviewed and committed, I am planning to forge ahead and commit this early next week, provided no objections or additional feedback materialize. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com