9.8

Testing for SQL-injection vulnerability:

  1. Suggest an approach for testing an application to find if it is vulnerable to SQL injection attacks on text input.

  2. Can SQL injection occur with forms of HTML input other than text boxes? If so, how would you test for vulnerability?


  1. One approach is to enter a string containing a single quote in each of the input text boxes of each of the forms provided by the application to see if the application correctly saves the value. If it does not save the value correctly and/or gives an error message, it is vulnerable to SQL injection.

  2. Yes, SQL injection can even occur with selection inputs such as drop-down menus, by modifying the value sent back to the server when the input value is chosen - for example by editing the page directly, or in the browser’s DOM tree. Most modern browsers provide a way for users to edit the DOM tree. This feature can be used to modify the values sent to the application, inserting a single quote into the value.