Question 210
An orders API directly concatenates a customer-supplied order number into a SQL statement, and a safe test changes query behavior. Which next step is most appropriate under the stated conditions?
Explanation
Correct Answer
Replace concatenation with properly parameterized queries under least privilege. The response must respect operational and evidence-preservation requirements rather than merely hiding a symptom.
Incorrect Answers
“Filter common SQL metacharacters while retaining direct string concatenation in queries” asserts more certainty than the records allow. Verify whether negative tests treat crafted inputs as data and return only authorized orders.
The generalization “Suppress database errors at the UI and leave unparameterized queries intact” does not follow from the available artifacts. Escaping selected characters is brittle compared with bound parameters.
“Add blacklist string matching while retaining direct SQL concatenation” excludes a plausible alternative without testing it. The source case reports that an orders API directly concatenates a customer-supplied order number into a SQL statement, and a safe test changes query behavior.