pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: [PATCH] Fixed malformed error message on malformed SCRAM message.
Date: Fri, 02 Jun 2017 02:20:00 -0400
Message-ID: <27186.1496384400@sss.pgh.pa.us> (raw)
In-Reply-To: <20170602055742.GA1502070@rfd.leadboat.com>
References: <CAB7nPqQrU1QyagF0i0MVw5_Cxy+YF+kJj5m8X5+qnNawn_UJuQ@mail.gmail.com>
	<20170529214021.kaw5qjzsbofaa6re@alvherre.pgsql>
	<CAB7nPqTBeEg1TFrZ+8uUWRnKVueDja+_LyTO2esPHRPQQQH8uQ@mail.gmail.com>
	<20170602055742.GA1502070@rfd.leadboat.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Noah Misch <noah@leadboat.com> writes:
> auth.c uses COMMERROR for this sort of thing; why does auth-scram.c use ERROR?

"COMMERROR" is more or less "LOG"; we'd have to throw a different error
afterwards if we reported these messages with COMMERROR.

The main case where COMMERROR is appropriate, I think, is where we think
that communication with the client has already failed and it's unlikely
that what we say will reach the client; but we'd like to be sure it
reaches the postmaster log.

There's a somewhat separate question of whether we'd be exposing useful
information to an attacker if we returned such details to the client.
Not entirely sure if any of these messages fall into that category, but
offhand I think that an attacker would already know if he's violating
protocol.

BTW, since you mention COMMERROR uses in auth.c, isn't the usage at
line 687 wrong?  It sure looks like the author supposed that that
ereport call wouldn't return, but it will.  Adjacent similar calls
clean up and return NULL.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (18+ messages)  latest in thread

Message-ID: <27186.1496384400@sss.pgh.pa.us>
Permalink:  ../27186.1496384400@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27186.1496384400@sss.pgh.pa.us

 · 

reply

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, noah@leadboat.com, michael.paquier@gmail.com, alvherre@2ndquadrant.com, daniele.varrazzo@gmail.com
  Subject: Re: [PATCH] Fixed malformed error message on malformed SCRAM message.
  In-Reply-To: <27186.1496384400@sss.pgh.pa.us>
  References: <CAB7nPqQrU1QyagF0i0MVw5_Cxy+YF+kJj5m8X5+qnNawn_UJuQ@mail.gmail.com> <20170529214021.kaw5qjzsbofaa6re@alvherre.pgsql> <CAB7nPqTBeEg1TFrZ+8uUWRnKVueDja+_LyTO2esPHRPQQQH8uQ@mail.gmail.com> <20170602055742.GA1502070@rfd.leadboat.com> <27186.1496384400@sss.pgh.pa.us>

* 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