Web Application Security Best
Practices"> Web Application Security Best Practices
Dont use C or any language that doesnt have automatic protection against buffer overflows. Java, a Web scripting language or a .Net language are all safe choices.
Validate incoming parameters in four ways before using them: their presence or absence, required length, required data type, and range within a set of permissible values. This also applies to variable data coming from cookies because they can be faked.
Use a generic error page to avoid leaking application or site configuration information.
Use a log-in manager or write standard code that ensures that every page requiring a user log-in checks to see that a log-in token exists in the server session.
All HTML output should go through an HTML validation checker that will filter out HTML control characters such as < and > or replace them with matching HTML escape sequences such as < and >. Dont forget to do this for e-mail as well because HTML-enabled e-mail clients are just Web browsers in disguise.
All parameters passed to the database should go through a SQL validation checker to escape special SQL characters such as a single quote.
Database access controls on base tables should restrict the Web application log-in to the bare-minimum functionality needed to run the application. Stored procedures that wrap application database calls provide safer ways to wrap application commands and automatic parameter type checking.
Encrypt sensitive application data such as user passwords and credit card data so that information loss will be limited if database security is breached.