nerdexam
EC-Council

112-52 · Question #146

Which technique is MOST effective in preventing SQL Injection attacks?

The correct answer is A. Input validation and prepared statements. Input validation combined with prepared statements forms the strongest defense against SQL injection because prepared statements separate SQL code from user-supplied data, making it impossible for malicious input to alter query logic - even if an attacker injects characters like

Web Application Security

Question

Which technique is MOST effective in preventing SQL Injection attacks?

Options

  • AInput validation and prepared statements
  • BDisabling TLS encryption
  • CAllowing dynamic SQL queries
  • DIncreasing database size

How the community answered

(43 responses)
  • A
    93% (40)
  • B
    2% (1)
  • D
    5% (2)

Explanation

Input validation combined with prepared statements forms the strongest defense against SQL injection because prepared statements separate SQL code from user-supplied data, making it impossible for malicious input to alter query logic - even if an attacker injects characters like '; DROP TABLE users; --, they are treated as literal data, not executable SQL.

Why the distractors fail:

  • B (Disabling TLS) removes encryption for data in transit, which actually worsens security and has no bearing on SQL injection.
  • C (Allowing dynamic SQL) is the root cause of SQL injection vulnerabilities - concatenating user input directly into queries is exactly what attackers exploit.
  • D (Increasing database size) is a capacity concern with zero relevance to attack prevention.

Memory tip: Think of prepared statements as a menu with fixed slots - the chef (database) only fills in the blanks (parameters) you allow; a customer can't rewrite the menu itself no matter what they write on the order slip.

Topics

#SQL Injection#Input Validation#Prepared Statements#Web Application Security

Community Discussion

No community discussion yet for this question.

Full 112-52 Practice