|
| |

Notes:
When it comes to discussing server security the World Wide Web is a special case. Not only do Web servers tend to be rushed to market without being thoroughly tested but it is one place where outsiders are given access to run programs through the various Web gateway mechanisms. Chief amongst these is the Common Gateway Interface, although Server Side Includes and the various server APIs play a significant role in opening up security holes.
CGI scripts offer two types of security hole:
1) They can leak useful information about the host
2) They can be tricked into performing operations not intended by the script author.
Using a compiled language can provide a bit more security compared to a scripting language. Script interpreters are large, complex programs that may contain their own security holes. Compiling the program also hides the implementation details from hackers.
Many off-the-shelf scripts and programs available over the Internet contain known security holes, check the CGI FAQ and CERT advisories before installation.
When writing CGI scripts take great care when processing user input. Never, ever pass anything unchecked to be executed by a command shell. Also remember that users can enter characters using the HTML character encodings. Your script is just another URL on the Web, it can be executed outside of the environment provided by a form. You cannot rely on any values contained in environment variables or hidden within the form itself.
Another major source of security holes are coding practices that allow character buffers to overflow when reading in user input. This can result in code submitted by the hacker being executed. This was problem in version 1.3 of the NCSA server and is common in user written scripts.
|