3. Testing for SQL Injection (OTG-INPVAL-005)
SQL Injection remains a problem in applications, yet it could easily be fixed. The following SQL statement is in an HTML form as code with the $ variables directly input from the user.
SELECT *
FROM Students
WHERE EMFLID = 'SEMPLID' AND EMAIL = 'Semail'
Would a form or application that includes this code be susceptible to SQL Injection? Why? What specific tests would you perform to determine if the application was vulnerable? How would you fix this problem? Be specific by providing the exact code in a language of your choice. (e.g. Java, PHP, Python)