1. Home
  2. Computer Science MCQs
  3. Cybersecurity
  4. An attacker types SQL code into a login form to bypass…

Added 2 Nov 2026

An attacker types SQL code into a login form to bypass authentication. What is the best primary defence?

  1. Hiding database error messages from users
  2. Encrypting database backups every night
  3. Locking accounts after three failed logins
  4. Parameterised queries (prepared statements) Correct answer

Correct answer

D. Parameterised queries (prepared statements)

10 views

MCQSEXAM

Explanation

Parameterised queries keep user input separate from SQL code, so input cannot change the query's logic. Hiding errors and lockouts may help a little but do not fix SQL injection.

Reference

Asked in: CISSP, Security+, NTS

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Cybersecurity MCQs

Practise all Cybersecurity MCQs

Similar MCQs