LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > CGI/Perl/Python > CGI Setup with access only to Perl binary.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-07-2009, 06:45 AM
28122008 28122008 is offline
Member
 
Join Date: Dec 2008
Posts: 13
Default CGI Setup with access only to Perl binary.

Hi there,

The default setup of litespeed has a CGI context for ~/cgi-bin which allows files in this directory with proper permissions to get executed by the interpretor supplied on shebang line within the script. Now this allows arbitrary commands to get executed on the system. For example the supplied helloworld script uses /bin/sh.

I want users to be able to access only /usr/bin/perl. I tried removing the CGI context and associating .pl & .cgi scripts with CGI Daemon. But then realized that it serves no purpose as the interpreter is still taken from the shebang line. Is there no way to simply associate .pl & .cgi with perl binary and disallow arbitrary access on system?

Also what is the way to disable Perl from executing external commands? Like in php.ini we can disable functions like exec(), system() etc. How its done with Perl?

-Regards,
Akash
Reply With Quote
  #2  
Old 09-08-2009, 10:00 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
I think that you cannot get what you want from any web server. CGI will work like that, you have to limit the access with file system permission if you want.
If Perl internal does not limit exec() and system(), nobody can.
Reply With Quote
  #3  
Old 09-08-2009, 10:06 AM
28122008 28122008 is offline
Member
 
Join Date: Dec 2008
Posts: 13
Quote:
Originally Posted by mistwang View Post
I think that you cannot get what you want from any web server. CGI will work like that, you have to limit the access with file system permission if you want.
If Perl internal does not limit exec() and system(), nobody can.
Lighttpd does allow to map extension based interpreter:

$HTTP["url"] =~ "/cgi-bin/" {
cgi.assign = ( ".pl" => "/usr/bin/perl" )
}
Reply With Quote
  #4  
Old 09-10-2009, 09:03 PM
28122008 28122008 is offline
Member
 
Join Date: Dec 2008
Posts: 13
Is something like:

cgi.assign = ( ".pl" => "/usr/bin/perl" )
cgi.assign = ( ".cgi" => "/usr/bin/perl" )

(as in Lighttpd) not possible in Litespeed?

-Regards,
Akash
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:33 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.