Skip site navigation (1) Skip section navigation (2)

Re: logfile subprocess and Fancy File Functions

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>,Andreas Pflug <pgadmin(at)pse-consulting(dot)de>,PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: logfile subprocess and Fancy File Functions
Date: 2004-07-24 16:12:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Thinking we have security because they can't guess
> > pgdata seems like security through obscurity to me.
> Sure, but it's still a useful roadblock to throw in an attacker's way.
> I spent many years doing computer security stuff, and one thing I
> learned is that the more layers of security you can have, the better.
> You don't put all your faith in any one roadblock; you erect a series
> of them that an attacker will have to break through all of.  If some
> of 'em are a little porous, that doesn't make 'em useless.
> In today's context, I think the main point of requiring an attacker
> to guess $PGDATA is that it helps avoid the "software monoculture"
> syndrome.  If someone did manage to write a Postgres-based virus that
> involved an exploit in this area, it could only spread to machines
> that had the $PGDATA value the virus writer was expecting.

As a super-user, could an attacker load a server-side language and
access the backend environment variable PGDATA.  Also look at this:

  test=> CREATE FUNCTION "xxx_call_handler" () RETURNS language_handler AS '$libdir/pltcl' LANGUAGE C;
  ERROR:  could not find function "xxx_call_handler" in file "/usr/var/local/postgres/lib/"

Notice the expansion of "$libdir".

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to


pgsql-patches by date

Next:From: Tom LaneDate: 2004-07-24 16:32:36
Subject: Re: logfile subprocess and Fancy File Functions
Previous:From: Bruce MomjianDate: 2004-07-24 16:01:04
Subject: Re: logfile subprocess and Fancy File Functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group