Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGfwN-0004Nj-Bj for pgsql-bugs@arkaria.postgresql.org; Fri, 02 Jun 2017 06:20:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dGfwM-0003BJ-Sa for pgsql-bugs@arkaria.postgresql.org; Fri, 02 Jun 2017 06:20:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dGfwM-0003Ap-C6 for pgsql-bugs@postgresql.org; Fri, 02 Jun 2017 06:20:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dGfwJ-0000c6-L0 for pgsql-bugs@postgresql.org; Fri, 02 Jun 2017 06:20:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v526K0Za027187; Fri, 2 Jun 2017 02:20:00 -0400 From: Tom Lane To: Noah Misch cc: Michael Paquier , Alvaro Herrera , Daniele Varrazzo , pgsql-bugs Subject: Re: [PATCH] Fixed malformed error message on malformed SCRAM message. In-reply-to: <20170602055742.GA1502070@rfd.leadboat.com> References: <20170529214021.kaw5qjzsbofaa6re@alvherre.pgsql> <20170602055742.GA1502070@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Fri, 02 Jun 2017 05:57:42 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27185.1496384400.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 02 Jun 2017 02:20:00 -0400 Message-ID: <27186.1496384400@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Noah Misch writes: > auth.c uses COMMERROR for this sort of thing; why does auth-scram.c use E= RROR? "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 --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs