Improving Web Application Security: Threats and Countermeasures

Examine how your application validates input because many Web application attacks use deliberately malformed input . SQL injection, cross-site scripting (XSS), buffer overflow, code injection, and numerous other denial of service and elevation of privilege attacks can exploit poor input validation. Table 5.1 highlights the most common input validation vulnerabilities.

Table 5.1: Common Input Validation Vulnerabilities

Vulnerability

Implications

Non- validated input in the Hypertext Markup Language (HTML) output stream

The application is susceptible to XSS attacks.

Non-validated input used to generate SQL queries

The application is susceptible to SQL injection attacks.

Reliance on client-side validation

Client validation is easily bypassed.

Use of input file names, URLs, or user names for security decisions

The application is susceptible to canonicalization bugs , leading to security flaws.

Application-only filters for malicious input

This is almost impossible to do correctly because of the enormous range of potentially malicious input. The application should constrain, reject, and sanitize input.

Review the following questions to help you identify potential input validation security issues:

How Do You Validate Input?

What approach to input validation does your design specify? First, your design should lay out the strategy. Your application should constrain, reject, and sanitize all of the input it receives. Constraining input is the best approach because validating data for known valid types, patterns, and ranges is much easier than validating data by looking for known bad characters . With a defense in depth strategy, you should also reject known bad input and sanitize input.

The following questions can help you identify potential vulnerabilities:

What Do You Do with the Input?

Check what your application does with its input because different types of processing can lead to various types of vulnerabilities. For example, if you use input in SQL queries your application is potentially vulnerable to SQL injection.

Review the following questions to help you identify possible vulnerabilities:

Категории