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 1p0HBX-0000v1-0X for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Nov 2022 07:07:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p0HBU-0007Df-WF for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Nov 2022 07:07:09 +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 1p0HBU-0007D1-FQ for pgsql-hackers@lists.postgresql.org; Wed, 30 Nov 2022 07:07:08 +0000 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p0HBS-0004jq-6p for pgsql-hackers@postgresql.org; Wed, 30 Nov 2022 07:07:08 +0000 Received: by mail-qv1-xf36.google.com with SMTP id q10so11361576qvt.10 for ; Tue, 29 Nov 2022 23:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=XurzZTxEkfh7JC04T/qapqmVlfajpAjMU7DnLne3vKU=; b=ekKUxp73xcIgJd2Bip8V8X5u4IsJRtfMUYxcUsV49lJ+BEKmBUt+dYixI+1AY7KcHB qbtMT3QZ7aa5KaaIK94CFvbMUYFEhIWM1QJr7isaDuPwBRzix8NEtx5l+Y5BVnOUJ4Le xyP7AKfKCPozvutLDrnw3ja0cXluGj8TIQ2To= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XurzZTxEkfh7JC04T/qapqmVlfajpAjMU7DnLne3vKU=; b=yTwK2xcGwOI2MWHkPBeew5fL6x21mMEhdYOgbxTqO96Qh3SlBtXIKn3u5LU1+GZtRF mD06B3X3NrWo7/rSkocejCyc47PgcFc96UJ3Sqb5DfNGbtv1KkzNm0fb8AeZHPE2DDxS Z3p0ALB5ohYhGpaoQwQWubJtUccpLp2ktT4uyFLq2wQhYyeQ0/KY70GQegrpqYiWOJqK TroC2PdnTz9L4Xf+jlWv8cVt+0duQR61Tg96Qg8GW7xsRDeXNcd2+3z+NMNSFHhnJNfn nckbfR0R6xaaSEa2Tv/1duRcdyEZ0Ngo+K47SrhGZ0BLBjtzmO9pdNbZaRASfRpNaEu3 pyuA== X-Gm-Message-State: ANoB5pmiapMSxt6lT1xty7dB2A3E/NBhXAjetsymZFHG2D0q0+rFj6Wx krssVicY2In+9PVz0sAwOe414A== X-Google-Smtp-Source: AA0mqf4kg8dgh/pZE1NwLVwXSqnm3L4bixo5/l9x1WF8vUQ6VCmsyvc0FZMInViZPQ9Rpr1z4V8WqA== X-Received: by 2002:a05:6214:81:b0:4bc:244e:86b5 with SMTP id n1-20020a056214008100b004bc244e86b5mr39802961qvr.94.1669792024486; Tue, 29 Nov 2022 23:07:04 -0800 (PST) Received: from rfd.leadboat.com ([2600:1702:a20:5750::2e]) by smtp.gmail.com with ESMTPSA id hj6-20020a05622a620600b003972790deb9sm370285qtb.84.2022.11.29.23.07.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Nov 2022 23:07:03 -0800 (PST) Date: Tue, 29 Nov 2022 23:07:01 -0800 From: Noah Misch To: Robert Haas Cc: "pgsql-hackers@postgresql.org" Subject: Re: pgsql: Revoke PUBLIC CREATE from public schema, now owned by pg_databas Message-ID: <20221130070701.GA275942@rfd.leadboat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Nov 29, 2022 at 02:22:59PM -0500, Robert Haas wrote: > On Fri, Sep 10, 2021 at 2:39 AM Noah Misch wrote: > > Revoke PUBLIC CREATE from public schema, now owned by pg_database_owner. > > > > This switches the default ACL to what the documentation has recommended > > since CVE-2018-1058. Upgrades will carry forward any old ownership and > > ACL. Sites that declined the 2018 recommendation should take a fresh > > look. Recipes for commissioning a new database cluster from scratch may > > need to create a schema, grant more privileges, etc. Out-of-tree test > > suites may require such updates. > > I was looking at the changes that this commit made to ddl.sgml today > and I feel that it's not quite ideal. Under "Constrain ordinary users > to user-private schemas" it first says "To implement this, first issue > REVOKE CREATE ON SCHEMA public FROM PUBLIC" and > then later says, oh but wait, you actually don't need to do that > unless you're upgrading. That seems a bit backwards to me: I think we > should talk about the current state of play first, and then add the > notes about upgrading afterwards. In general, the documentation should prefer simpler decision trees. Especially so where the wrong choice causes no error, yet leaves a security vulnerability. The unconditional REVOKE has no drawbacks; it's harmless where it's a no-op. That was the rationale behind the current text. Upgrades aren't the only issue; another DBA may have changed the ACL since initdb.