Re: [GENERAL] worried about PGPASSWORD drop

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)atentus(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [GENERAL] worried about PGPASSWORD drop
Date: 2002-08-29 22:06:15
Message-ID: Pine.LNX.4.21.0208292300310.667-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

On Thu, 29 Aug 2002, Bruce Momjian wrote:

> Nigel J. Andrews wrote:
> > On Wed, 28 Aug 2002, Alvaro Herrera wrote:
> >
> > > En Wed, 28 Aug 2002 17:33:34 -0400 (EDT)
> > >
> > > Thank you. Patch attached. Note that it also checks group access; I think
> > > that is desired as well.
> >
> > +
> > + /* If password file is insecure, alert the user and ignore it. */
> > + if (stat_buf.st_mode & (S_IRWXG | S_IRWXO))
> >
> >
> > Should there also be a S_IFREG check to make sure no one is trying any other
> > tricks? I'm not sure of what an exploit would be but for the sake of paranoia
> > it seems a cheap test.
> >
> > I take it no one wants to start checking directory tree permissions etc.
>
> They may want a symlink to point to somewhere else. I can see that. In
> fact, I can see settings for Unix group sharing a password file but I am
> not going to suggest loosening the group permissions until someone says
> they want that.

Doesn't stat() resolve all symlinks?

I must admit it's not something I've check but I thought it went through until
it found a non symlink.

I'm probably just being too paranoid about pipes etc. though.

I'd wait and see about the group permissions as well. I can't really see the
need myself. I'm not very imaginative at times though. May be in a teaching
environment.

--
Nigel J. Andrews

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-08-29 23:06:35 Re: [GENERAL] worried about PGPASSWORD drop
Previous Message Andrew Sullivan 2002-08-29 21:44:00 Re: [Pgreplication-general] Master/Slave is in town!

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2002-08-29 22:15:42 Re: Patch for pt_BR (libpq) - part two
Previous Message Bruce Momjian 2002-08-29 21:45:56 Re: fix for palloc() of user-supplied length