Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 462C5B5DD2D for ; Mon, 12 Sep 2011 15:21:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 58455-01-4 for ; Mon, 12 Sep 2011 18:21:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fetter.org (173-164-140-181-SFBA.hfc.comcastbusiness.net [173.164.140.181]) by mail.postgresql.org (Postfix) with ESMTP id 2EF57B5DDAD for ; Mon, 12 Sep 2011 15:20:20 -0300 (ADT) Received: by fetter.org (Postfix, from userid 500) id 3CA813C0449; Mon, 12 Sep 2011 11:20:20 -0700 (PDT) Date: Mon, 12 Sep 2011 11:20:20 -0700 From: David Fetter To: Magnus Hagander Cc: PG Hackers Subject: Re: Re: [BUGS] BUG #6189: libpq: sslmode=require verifies server certificate if root.crt is present Message-ID: <20110912182020.GA14015@fetter.org> References: <201108310959.p7V9xIRp030425@wwwmaster.postgresql.org> <20110912172126.GA12610@fetter.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.918 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201109/625 X-Sequence-Number: 194814 On Mon, Sep 12, 2011 at 07:37:23PM +0200, Magnus Hagander wrote: > On Mon, Sep 12, 2011 at 19:21, David Fetter wrote: > > On Wed, Aug 31, 2011 at 09:59:18AM +0000, Srinivas Aji wrote: > >> > >> The following bug has been logged online: > >> > >> Bug reference:      6189 > >> Logged by:          Srinivas Aji > >> Email address:      srinivas.aji@emc.com > >> PostgreSQL version: 9.0.4 > >> Operating system:   Linux > >> Description:        libpq: sslmode=require verifies server certificate if > >> root.crt is present > >> Details: > >> > >> >From the documentation of sslmode values in > >> http://www.postgresql.org/docs/9.0/static/libpq-ssl.html , > >> it looks like libpq will not verify the server certificate when the option > >> sslmode=require is used, and will perform different levels of certificate > >> verification in the cases sslmode=verify-ca and sslmode=verify-full. > >> > >> The observed behaviour is a bit different. If the ~/.postgresql/root.crt > >> file (or any other filename set through sslrootcert option) is found, > >> sslmode=require also performs the same level of certificate verification as > >> verify-ca. The difference between require and verify-ca is that it is an > >> error for the file to not exist when sslmode is verify-ca. > >> > >> Thanks, > >> Srinivas > > > > It looks to me like there could at least in theory be an attack vector > > or two that we're not covering with this bug.  Anybody want to tackle > > same? > > I haven't checked the code yet, but from the report it sounds like > we're checking *too much* - how could that be an attack vector? Well, "too much checking," classically, is a source of denial of service attacks. It's not a super likely source, but it's a source, and it'd be better to fix it than leave it lie. :) Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate