Received: from smtp4.mail.yahoo.com (smtp4.mail.yahoo.com [128.11.69.101]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f18DJhx06816 for ; Thu, 8 Feb 2001 08:19:43 -0500 (EST) (envelope-from janwieck@yahoo.com) Received: from a5c54.pppool.de (HELO jupiter.greatbridge.com) (213.6.92.84) by smtp.mail.vip.suc.yahoo.com with SMTP; 8 Feb 2001 13:19:37 -0000 X-Apparently-From: Received: (from janwieck@localhost) by jupiter.greatbridge.com (8.9.3/8.9.3) id HAA03543; Thu, 8 Feb 2001 07:10:08 -0500 From: Jan Wieck Message-Id: <200102081210.HAA03543@jupiter.greatbridge.com> Subject: Re: pl/perl and security In-Reply-To: <95otpc$hj4$1@news.tht.net> from CMVV at "Feb 6, 2001 01:22:59 pm" To: CMVV Date: Thu, 8 Feb 2001 07:10:08 -0500 (EST) CC: pgsql-interfaces@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200102/58 X-Sequence-Number: 1011 CMVV wrote: > Hi, > > I have discovered that in pl/perl we cannot make use of file handling. > The README file in ../pl/plperl give us an hint with an example of a > badfunc(). > What are the security reasons to do so, since with postgresql extensions > (functions) written in C language we can do anything with flat files ? > Can this security issue with pl/perl be overrided ? > If so, how can i hack it ? > It will be so nice to manage files from server-based functions written in > pl/perl. > Thanx The security issue is that PL/Perl is designed to be a trusted procedural language. Meaning, any unprivileged user can create functions in it. Having file access, which is done under the UNIX-userid running the postmaster process, any user could modify your pg_hba.conf ... The same applies for PL/Tcl, why there will be an untrusted PL/TclU in 7.1, where only DB superusers can define functions in it. I'm not a Perl guy, but AFAIK you can modify the command mask used for the perl interpreter in the PL handler. But be sure to restrict your patched version of PL/Perl to superusers, or accept that you created a big security hole. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com