A script is a program and a program running on any computer has access to the files running on the computer it is on. Regardless of security updates for the Operating system itself, there are MANY other security concerns that plague
web servers. Of those concerns, one major one is sloppy programming.
A perl script has the ability to "shell" to system commands and execute them.
If a hacker finds a way to pass system level commands to a perl script which
was programmed sloppy, then the hacker can execute any command that
the web server itself has access to run. Whatever username your web server runs
as is the username that the script is running as.
Many files are accessable by normal non-root users.
Because of this, there are literally thousands of ways to exploit a server
as a regular old user and even possibly gain root access.
WARNING: Just because you updated your Linux or FreeBSD distribution does
not protect you from hackers who exploit shoddy programming. The CGI scripts themselves need to be secured to prevent the script from running any commands that a would-be hacker passes to it.
Here are some url's to look at:
http://www.cert.org/tech_tips/cgi_metacharacters.html#1
http://www.cert.org/vendor_bulletins/VB-98.01.excite
http://www.kb.cert.org/vuls/id/496064
GREAT sites you should frequently read:
http://www.cert.org
http://www.securityfocus.com
Sample Report:
Vulnerability Note VU#496064
ibrow NewsDesk does not securely handle input passed to open()
Overview
A vulnerability in ibrow NewsDesk allows an attacker to view files and execute operating system commands with the privileges of the web server.
I. Description
ibrow NewsDesk is a Perl CGI script that is designed to create and display news articles on a web site. The code for NewsDesk is implemented in the file newsdesk.cgi. This code accepts input from a URL and uses this data in an argument to the Perl open() command. Since NewsDesk does not adequately filter URL input, it is possible to construct a URL containing shell meta-characters such as "../" and "|" (pipe), and these characters will be processed with the privileges of the web server.
II. Impact
By submitting a specially crafted URL, an attacker can execute operating system commands and traverse the file system and read files with the permission of the web server.
III. Solution
The CERT/CC is currently unaware of a practical solution to this problem.
Modify NewsDesk
* Modify newsdesk.cgi to only allow acceptable characters in URL input that is passed to open(). This type of input validation is referred to as "positive" or "whitelist" filtering. See Laundering and Detecting Tainted Data in perlsec for more information.
* Enabling Perl "taint" checking will prevent execution of commands using the pipe character ("|"). See perlsec and the Secure Programming for Linux and Unix HOWTO for more information.
* Rewrite the vulnerable open() calls in newsdesk.cgi to be safer, possibly by using sysopen(). See perlopentut for more information.
Systems Affected
Vendor Status Date Updated
ibrow Vulnerable 2-Apr-2002