From: Jonathan S. Katz <jkatz@postgresql.org>
To: Magnus Hagander <magnus@hagander.net>
To: Andres Freund <andres@anarazel.de>
Cc: Brad Nicholson <bradn@ca.ibm.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Daniel Verite <daniel@manitou-mail.org>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: CVE-2019-9193 about COPY FROM/TO PROGRAM
Date: Tue, 2 Apr 2019 14:51:02 -0400
Message-ID: <6630e8e9-e2a5-fb01-8f00-b8faac502007@postgresql.org> (raw)
In-Reply-To: <CABUevEwDh-ZAQ8gE1xCygNN0VhUrQuqtQA1kQtq2VV8t3rQ4BQ@mail.gmail.com>
References: <e6251b54-78f4-4ec0-8e22-8c4179f0e817@manitou-mail.org>
<8059.1553980568@sss.pgh.pa.us>
<CABUevEz3Rw+Q6K1NjtkNsh6tME4omjm+ywmpwEVLAjctJ+pWYg@mail.gmail.com>
<6962.1554126913@sss.pgh.pa.us>
<A2F7EB11-7B4B-452D-8DEA-0DCD88535FE5@postgresql.org>
<20190402050501.GN16093@paquier.xyz>
<OF1C5515C9.AC2B9DD6-ON852583D0.0044DEB2-852583D0.0045202D@notes.na.collabserv.com>
<20190402153125.zku2f26kuzfq5gsz@alap3.anarazel.de>
<CABUevEwDh-ZAQ8gE1xCygNN0VhUrQuqtQA1kQtq2VV8t3rQ4BQ@mail.gmail.com>
On 4/2/19 2:08 PM, Magnus Hagander wrote:
> On Tue, Apr 2, 2019 at 5:31 PM Andres Freund <andres@anarazel.de
> <mailto:andres@anarazel.de>> wrote:
>
> Hi,
>
> On 2019-04-02 07:35:02 -0500, Brad Nicholson wrote:
> > Michael Paquier <michael@paquier.xyz <mailto:michael@paquier.xyz>>
> wrote on 04/02/2019 01:05:01 AM:
> >
> > > From: Michael Paquier <michael@paquier.xyz
> <mailto:michael@paquier.xyz>>
> > > To: "Jonathan S. Katz" <jkatz@postgresql.org
> <mailto:jkatz@postgresql.org>>
> > > Cc: Tom Lane <tgl@sss.pgh.pa.us <mailto:tgl@sss.pgh.pa.us>>,
> Magnus Hagander
> > > <magnus@hagander.net <mailto:magnus@hagander.net>>, Daniel
> Verite <daniel@manitou-mail.org <mailto:daniel@manitou-mail.org>>,
> > > pgsql-general <pgsql-general@lists.postgresql.org
> <mailto:pgsql-general@lists.postgresql.org>>
> > > Date: 04/02/2019 01:05 AM
> > > Subject: Re: CVE-2019-9193 about COPY FROM/TO PROGRAM
> > >
> > > On Mon, Apr 01, 2019 at 10:04:32AM -0400, Jonathan S. Katz wrote:
> > > > +1, though I’d want to see if people get noisier about it
> before we
> > rule
> > > > out an official response.
> > > >
> > > > A blog post from a reputable author who can speak to security
> should
> > > > be good enough and we can make noise through our various channels.
> > >
> > > Need a hand? Not sure if I am reputable enough though :)
> > >
> > > By the way, it could be the occasion to consider an official
> > > PostgreSQL blog on the main website. News are not really a model
> > > adapted for problem analysis and for entering into technical
> details.
> >
> > A blog post would be nice, but it seems to me have something about
> this
> > clearly in the manual would be best, assuming it's not there
> already. I
> > took a quick look, and couldn't find anything.
>
> https://www.postgresql.org/docs/devel/sql-copy.html
>
> "Note that the command is invoked by the shell, so if you need to pass
> any arguments to shell command that come from an untrusted source, you
> must be careful to strip or escape any special characters that might
> have a special meaning for the shell. For security reasons, it is best
> to use a fixed command string, or at least avoid passing any user input
> in it."
>
> "Similarly, the command specified with PROGRAM is executed directly by
> the server, not by the client application, must be executable by the
> PostgreSQL user. COPY naming a file or command is only allowed to
> database superusers or users who are granted one of the default roles
> pg_read_server_files, pg_write_server_files, or
> pg_execute_server_program, since it allows reading or writing any file
> or running a program that the server has privileges to access."
>
> Those seem reasonable to me?
>
>
> Agreed, that part can't really be much clearer.
>
> But perhaps we should add a warning box
> to https://www.postgresql.org/docs/11/sql-createrole.html that basically
> says "creating a superuser means they can x, y and z"?
Yeah, I think that's the path forward -- make it much clearer by putting
it in the warning box and just re-stating that this is what it means.
Jonathan
Attachments:
signature.asc (application/pgp-signature, 832B) download
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-general@postgresql.org
Cc: jkatz@postgresql.org, magnus@hagander.net, andres@anarazel.de, bradn@ca.ibm.com, michael@paquier.xyz, daniel@manitou-mail.org, tgl@sss.pgh.pa.us
Subject: Re: CVE-2019-9193 about COPY FROM/TO PROGRAM
In-Reply-To: <6630e8e9-e2a5-fb01-8f00-b8faac502007@postgresql.org>
References: <e6251b54-78f4-4ec0-8e22-8c4179f0e817@manitou-mail.org> <8059.1553980568@sss.pgh.pa.us> <CABUevEz3Rw+Q6K1NjtkNsh6tME4omjm+ywmpwEVLAjctJ+pWYg@mail.gmail.com> <6962.1554126913@sss.pgh.pa.us> <A2F7EB11-7B4B-452D-8DEA-0DCD88535FE5@postgresql.org> <20190402050501.GN16093@paquier.xyz> <OF1C5515C9.AC2B9DD6-ON852583D0.0044DEB2-852583D0.0045202D@notes.na.collabserv.com> <20190402153125.zku2f26kuzfq5gsz@alap3.anarazel.de> <CABUevEwDh-ZAQ8gE1xCygNN0VhUrQuqtQA1kQtq2VV8t3rQ4BQ@mail.gmail.com> <6630e8e9-e2a5-fb01-8f00-b8faac502007@postgresql.org>
* 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