Testing for SQL Injection
SQL Injection is an attack that injects a SQL query mainly in input fields to unauthorizedly view database data, perform modifications to database data, or execute commands to control the underlying infrastructure. SQL Injection is considered one of the most common web application attacks. SQL Injection is a critical web application vulnerability; a successful attack can enable the attacker to make modifications (delete, view, or edit) to all the data stored in the database or execute commands on the underlying system.
It is important to prevent SQL Injection attacks; some of the techniques to prevent them are listed here:
- Using parameterized queries, which prevents the application from adding the user’s input directly to the database query. This enables the developer to hardcode the SQL query and then pass the user’s input as parameters to the query.
- Escaping user input, which escapes special characters in the query. SQL Injection...