Why is Form Validation Needed?
Form validation is required to prevent web form abuse by malicious users. Improper validation of form data is one of the main causes of security vulnerabilities. It exposes your website to attacks such as header injections, cross-site scripting, and SQL injections. • header injection attacks can be used to send email spam from your web server • cross-site scripting may allow an attacker to post any data to your site • SQL injection may corrupt your database backend Form data validation is not trivial, because it depends on the context where individual data items are used, and on content encoding.