Re: pgcrypto seeding problem when ssl=on

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Marko Kreen <markokr(at)gmail(dot)com>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgcrypto seeding problem when ssl=on
Date: 2012-12-24 00:26:39
Message-ID: 20121224002639.GA11514@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Dec 23, 2012 at 02:49:08PM -0500, Tom Lane wrote:
> Noah Misch <noah(at)leadboat(dot)com> writes:
> > On Sat, Dec 22, 2012 at 02:20:56PM -0500, Tom Lane wrote:
> >> #ifdef USE_SSL
> >> if (EnableSSL)
> >> {
> >> struct timeval tv;
> >>
> >> gettimeofday(&tv, NULL);
> >> RAND_add(&tv, sizeof(tv), 0);
> >> }
> >> #endif
>
> > Take the caution one step further and make it independent of EnableSSL. In a
> > stock installation, a !EnableSSL postmaster will never seed its PRNG, and
> > there's no vulnerability. Add a shared_preload_libraries module that uses the
> > OpenSSL PRNG in its _PG_init(), and suddenly you're vulnerable again.
>
> Meh. In a postmaster that wasn't built with SSL support at all, such
> a module is still dangerous (and I'm not convinced anybody would build
> such a module anyway). I think we should confine our ambitions to
> preventing security issues caused by our own code.

You're adding lines of code to prematurely micro-optimize the backend fork
cycle. If code introduced into the postmaster, by us or others, ever violates
the assumption behind that micro-optimization, certain users get a precipitous
loss of security with no clear alarm bells. I don't like that trade.

nm

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2012-12-24 01:41:37 Re: PATCH: optimized DROP of multiple tables within a transaction
Previous Message Greg Stark 2012-12-24 00:01:39 Re: initdb and share/postgresql.conf.sample