In short, never grant write permission to any file on your web server unless you are specifically editing that file. Finally, backup your files regularly. Expect and prepare for the worst. All input is an attempted hack. All input is an attempted hack.
All input is an attempted hack.
Learn those words and repeat them to yourself every day. It is essential for you to consider all information that comes into your CGI script as tainted. The example provided by Lincoln Stein above is a good example of the kinds of havoc a cracker can create with tainted data. A cracker could easily attempt to use your CGI to execute damaging commands. That is, if your server is set to execute server side includes, it is possible that your CGI script could be used to execute illegitimate code.