Multiple choice technology security

Out of the following which one can be considered as a possible solutions for SQL injection vulnerability?

  1. Data Validation

  2. Secure Cookies

  3. Encryption

  4. Comprehensive exception handling

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Data validation (input whitelisting, type checking, length limits) is the primary defense against SQL injection - it ensures only expected input reaches the database. Secure cookies prevent theft but not injection, encryption protects data at rest (not query manipulation), and exception handling manages errors rather than preventing injection itself.