The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Web Programming, Web 2.0 and Mashups
.
google unix.com



Web Programming, Web 2.0 and Mashups Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, Flash, HTML, SEO, Mashups and other Web APIs and topics.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl Script issue. What am I doing wrong? SkySmart Shell Programming and Scripting 14 03-19-2009 05:22 PM
Perl Script Issue - Please Help * Thanks!!! jroberson Shell Programming and Scripting 8 11-03-2008 03:47 AM
[Perl] Accessing array elements within a sed command in Perl script userix Shell Programming and Scripting 2 10-03-2008 12:05 PM
concurrency issue while Accessing Mail Box from shell script Sumit_Fundoo UNIX for Advanced & Expert Users 2 02-25-2007 02:23 PM
accessing variables declared in another perl script gurukottur Shell Programming and Scripting 3 11-09-2006 09:22 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-30-2009
z1dane's Avatar
z1dane z1dane is offline
Registered User
  
 

Join Date: Aug 2007
Location: Brisbane, Australia
Posts: 28
Accessing a Perl CGI script, security issue

Hi Everybody,

I was wondering if it was possible for someone to gain access to my Perl CGI scripts before they are interpreted by Perl (mod_perl on apache2) i.e. getting a hold of my raw scripts and not the html output?

Let's say I use the DBI module where I have the hostname, user and password stored in my CGI script (currently I store these parameters in another file and the user only has select privileges anyway), is there a way to prevent someone from getting the script as it is (if it is possible)?

Many thanks,

Dave
  #2 (permalink)  
Old 07-30-2009
pludi's Avatar
pludi pludi is online now Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,839
Usually, no.
But generally, 3 ways come to mind:
  • If the HTTP server is configured wrong and doesn't recognize the scripts as executables, and serves the content instead
  • If another application on the same server is vulnerable to relative path errors, eg instead of calling /xyz/abc.html the attacker can call /xyz/../../cgi-bin/script.pl
  • If you've got a script that uses templates with variables passed through POST. Those could be set also via GET and potentially serve content you wanted hidden
  #3 (permalink)  
Old 07-30-2009
z1dane's Avatar
z1dane z1dane is offline
Registered User
  
 

Join Date: Aug 2007
Location: Brisbane, Australia
Posts: 28
Thank you very much for your reply pludi.

>If the HTTP server is configured wrong and doesn't recognize the scripts as executables, and serves the content instead

I guess this isn't a problem, since http://domain/script.pl executes.

>If another application on the same server is vulnerable to relative path errors, eg instead of calling /xyz/cgi-bin/script.pl

Could you give me an example of such an application?

>If you've got a script that uses templates with variables passed through POST. Those could be set also via GET and potentially serve content you wanted hidden

I'll keep this in mind when I'm building forms and passing variables.

Thanks again,

Dave
Reply

Bookmarks

Tags
cgi, perl, security

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0