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 1q8s5T-0002AK-MA for pgsql-committers@arkaria.postgresql.org; Tue, 13 Jun 2023 00:40:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q8s5S-0000qJ-8o for pgsql-committers@arkaria.postgresql.org; Tue, 13 Jun 2023 00:40:42 +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 1q8s5S-0000qA-21 for pgsql-committers@lists.postgresql.org; Tue, 13 Jun 2023 00:40:42 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q8s5M-001sg3-Ba for pgsql-committers@lists.postgresql.org; Tue, 13 Jun 2023 00:40:40 +0000 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-54fac3b7725so458305a12.3 for ; Mon, 12 Jun 2023 17:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1686616835; x=1689208835; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=LuWwHhL0jSFQ+EMyVmrnL4lAaa6m21q+9Ni0h8KLwIs=; b=rIb/bjCWpqoXdrl21prQ9TixuSgVrT/Pj8de/N62S2sRGZcVOudlBm8UUUBoGoCGl7 bUuR8HL+rvhqig35Bh2PpFbNZxPiAiuudvOpj6z1GkyhbsIwn59r62zV/bRjE8EKYUn3 vc+ArfhPz4orKrMHkHh5P13l72UXcRUhFuWFxAywOInDYIgOnb4xfuSJRcEU6NsIQOqC IMATOT2Oi/6jWXpSrDJflA6kp+UYF6mXZtzOdFax/gX3GD0NUfvN7dGPtTIVO8Tv5Say 7NU5vrq/KZVsuC67b6W0FUXJa82+fVdMksYBmncErMBZ15rm0oCb5HZmrbrcOGL2Bijo 5mVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686616835; x=1689208835; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=LuWwHhL0jSFQ+EMyVmrnL4lAaa6m21q+9Ni0h8KLwIs=; b=DpHSjtDKIhLVZ09aROQg7xIR+ptO/T7X4mvFs0tb40B9dK3vaY9g/C6dmhS9Cs0ysJ CE/bNNY6d3Rzu1YvPk79QsV3uwWMbCahn9oUUFrMHxtBsrxnfekGYbKUSL0Nm+eKIxS4 AIounDhMAPLpxAl7OTg8Xv9HodZpVZgrlKBmve1Xl4qz8KpxlsDGw1xi0VlrBn8wzPXR hz52ZvLUMM/SOxS/3Pl/05u4/Teih8NajJgJurXKVtY6h7j9eGprNn8P1HWpvhfXbK0C hEMscLHw1s/BhT2VAPeg2OvNRVnry+So0xpwhqnRa205Ny4D9CPid5DkSaaO3PnPpqTB 2dMw== X-Gm-Message-State: AC+VfDwBVXpd42lMHv2nSHZVO4D25o7cmqyg6ACI+Ki3AHeOOfcYzW4A bp+UzAkgYc9PJaq/ZiwYooednw== X-Google-Smtp-Source: ACHHUZ5o9sQil6fB6mAcvXV7oaNFyLbDQpuv1n8Zl9/1Ls3Pc9Yd96NHFIEtF6cVVIYOaXkXapVEcQ== X-Received: by 2002:a05:6a20:1584:b0:11d:2b0c:7f49 with SMTP id h4-20020a056a20158400b0011d2b0c7f49mr15466pzj.36.1686616834935; Mon, 12 Jun 2023 17:40:34 -0700 (PDT) Received: from [172.24.1.9] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id jj15-20020a170903048f00b001ae5d21e95csm8859866plb.117.2023.06.12.17.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 17:39:56 -0700 (PDT) Message-ID: Subject: Re: pgsql: Fix search_path to a safe value during maintenance operations. From: Jeff Davis To: Noah Misch , Tom Lane Cc: Jeff Davis , pgsql-committers@lists.postgresql.org Date: Mon, 12 Jun 2023 17:39:40 -0700 In-Reply-To: <20230612170510.GA201972@gust.leadboat.com> References: <89a415b86d5421941e4281ba5bf6288934078624.camel@j-davis.com> <573014.1686375211@sss.pgh.pa.us> <20230612170510.GA201972@gust.leadboat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-06-12 at 13:05 -0400, Noah Misch wrote: > The timing was not great, but this is fixing a purported defect in an > older > v16 feature.=C2=A0 If the MAINTAIN privilege is actually fine, we're all > set for > v16.=C2=A0 If MAINTAIN does have a material problem that $SUBJECT had > fixed, we > should either revert MAINTAIN, un-revert $SUBJECT, or fix the problem > a > different way. Someone with the MAINTAIN privilege on a table can use search_path tricks against the table owner, if the code is susceptible, because maintenance code runs with the privileges of the table owner. I was concerned enough to bring it up on the -security list, and then to -hackers followed by a commit (too late). But perhaps that was paranoia: the practical risk is probably quite low, because a user with the MAINTAIN privilege is likely to be highly trusted. I'd like to hear from others on the topic about the relative risks of shipping with/without the search_path changes. I don't think a full revert of the MAINTAIN privilege is the right thing -- the predefined role is very valuable and many other predefined roles are much more dangerous than pg_maintain is. Regards, Jeff Davis