- Home
- All questions
- Question 142
CompTIA Security+ study material · question 142 of 611
A report lets the user choose which column to sort by, and the column name goes into the query. Parameters cannot bind an identifier. What is the correct defence?
Show the answer
Answer: B. Map the user's choice against an allow-list of permitted column names
Identifiers cannot be bound as parameters, so the only safe pattern is selecting from a fixed set of known-good values.
Source: OWASP SQL Injection Prevention Cheat Sheet (OWASP) — OWASP SQL Injection Prevention Cheat Sheet › Defense Option 4