← Quiz: SQL Injection: all 10 questions
Quiz: SQL Injection · Question 3 of 10
A sort column comes from the URL (?sort=price). Placeholders can't be used for column names. What should you do?
A sort column comes from the URL (?sort=price). Placeholders can't be used for column names. What should you do?
- A.Concatenate it directly
- B.Check it against an allow-list of known columns
- C.Remove quotes from it
- D.Encode it in Base64
Answer & explanation
Correct answer: Check it against an allow-list of known columns
Identifiers can't be parameterised, so only accept values from a fixed allow-list.
Can you get the rest right without peeking?
Take the timed Quiz: SQL Injection quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →