From: Noah Misch <noah@leadboat.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: pgsql: Revoke PUBLIC CREATE from public schema, now owned by pg_databas
Date: Tue, 29 Nov 2022 23:07:01 -0800
Message-ID: <20221130070701.GA275942@rfd.leadboat.com> (raw)
In-Reply-To: <CA+TgmoYUHsfp90inEMAP0yNr7Y_L6EphPH1YOon1JKtBztXHyQ@mail.gmail.com>
References: <E1mOaBy-0006mH-1P@gemulon.postgresql.org>
<CA+TgmoYUHsfp90inEMAP0yNr7Y_L6EphPH1YOon1JKtBztXHyQ@mail.gmail.com>
On Tue, Nov 29, 2022 at 02:22:59PM -0500, Robert Haas wrote:
> On Fri, Sep 10, 2021 at 2:39 AM Noah Misch <noah@leadboat.com> 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
> <literal>REVOKE CREATE ON SCHEMA public FROM PUBLIC</literal>" 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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: noah@leadboat.com, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: pgsql: Revoke PUBLIC CREATE from public schema, now owned by pg_databas
In-Reply-To: <20221130070701.GA275942@rfd.leadboat.com>
References: <E1mOaBy-0006mH-1P@gemulon.postgresql.org> <CA+TgmoYUHsfp90inEMAP0yNr7Y_L6EphPH1YOon1JKtBztXHyQ@mail.gmail.com> <20221130070701.GA275942@rfd.leadboat.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox