Re: First feature patch for plperl - draft [PATCH] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: First feature patch for plperl - draft [PATCH]
Date
Msg-id 17793.1260031296@sss.pgh.pa.us
Whole thread Raw
In response to Re: First feature patch for plperl - draft [PATCH]  (Tim Bunce <Tim.Bunce@pobox.com>)
Responses Re: First feature patch for plperl - draft [PATCH]  (Tim Bunce <Tim.Bunce@pobox.com>)
List pgsql-hackers
Tim Bunce <Tim.Bunce@pobox.com> writes:
> I'll modify the patch to disable the SPI functions during
> initialization (both on_perl_init and on_(un)trusted_init). 

Yeah, in the shower this morning I was thinking that not loading
SPI till after the on_init code runs would alleviate the concerns
about transactionality and permissions --- that would ensure that
whatever on_init does affects only the Perl world and not the database
world.

However, we're not out of the woods yet.  In a trusted interpreter
(plperl not plperlu), is the on_init code executed before we lock down
the interpreter with Safe?  I would think it has to be since the main
point AFAICS is to let you preload code via "use".  But then what is
left of the security guarantees of plperl?  I can hardly imagine DBAs
wanting to vet a few thousand lines of random Perl code to see if it
contains anything that could be subverted.  For example, the ability
to scribble on database files (like say pg_hba.conf) would almost surely
be easy to come by.

If you're willing to also confine the feature to plperlu, then maybe
the risk level could be decreased from insane to merely unreasonable.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: PostgreSQL Release Support Policy
Next
From: Andrew Dunstan
Date:
Subject: Re: First feature patch for plperl - draft [PATCH]