Developer's Guide to Web Application Security

As a programmer working on a Web application, you already know that if you want your site to do something such as gather information through forms or customize itself to your users, you will have to go beyond Hypertext Markup Language (HTML). You will have to do Web programming, and the most common form used today is Common Gateway Interface (CGI). CGI applies rules for running external programs in a Web HTTP server. External programs are called gateways because they open outside information to the server.
There are other ways to customize or add client activity to your Web site. You could use JavaScript, which is a client-side scripting language. If, as a developer you are looking for quick and easy interactive changes to your Web site, CGI is the way to go. A common example of CGI would be a "visitor counter" on a Web site. CGI can do just about anything to make your Web site more interactive. It can grab records from a database, use incoming forms, save data to a file, or return information to the client side, just to name a few features. As a developer, you have numerous choices for which language to write your CGI scripts in Perl, Java, and C++ are a just a few of the choices.
Of course, you have to consider security when working with CGI. Vulnerable CGI programs are attractive to hackers because they are simple to locate, and operate using the privileges and power of the...