🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: SQL Injection: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Why did the username admin' -- log in without a password?
  2. Q2. What is the correct fix for SQL injection?
  3. Q3. A sort column comes from the URL (?sort=price). Placeholders can't be used for column names. What should you do?
  4. Q4. In section 3, what did the UNION attack return?
  5. Q5. Which subprocess call is safest for running ping on a user-supplied host?
  6. Q6. What is the root cause of SQL injection?
  7. Q7. Which JDBC code is safe?
  8. Q8. Why should the web application's database user not have DROP permission?
  9. Q9. Why should raw database errors not be shown to users?
  10. Q10. A MongoDB login accepts JSON and an attacker sends {"password": {"$ne": ""}}. What is the fix?