CompTIA

CAS-005 practice question 3

CompTIA SecurityX · free question 3 of 20

Question

A security architect discovers the following while reviewing code for a company's website: ``` selection = "SELECT Item FROM Catalog WHERE ItemID = " & Request("ItemID") ``` Which of the following should the security architect recommend?
  • A. Client-side processing
  • B. Query parameterization Correct
  • C. Data normalization
  • D. Escape character blocking
  • E. URL encoding

Explanation

The code concatenates user input straight into a SQL statement, which allows SQL injection. Parameterized queries (prepared statements) send the input as data, separate from the SQL command, so it can never change the query's structure. Client-side processing can be bypassed, escaping or blocking characters is error-prone and incomplete, and URL encoding and data normalization do not stop injection.

Practice the whole free set

Answer all 20 free CAS-005 questions with instant feedback, or unlock all 426 questions with Learn and Exam modes.