Question 100
A web form appends a visitor-supplied name directly into a database statement, allowing crafted input to change its WHERE clause. Which weakness enables the result?
Explanation
Correct Answer
Untrusted values alter SQL structure because the application fails to separate query logic from parameters. The key technical distinction is which interpreter or trust boundary the attacker controls; input becoming executable query syntax, script, command or a privileged server request requires different safeguards. The case turns on allowing crafted input to change its WHERE clause; “SQL injection through unsafely constructed queries” addresses that precise condition. “Cross-site scripting executed in the visitor's browser” is not equivalent because the demonstrated manipulation changes backend SQL selection, not client script execution.
Incorrect Answers
Randomness quality does not cause input to become executable SQL syntax. Software vulnerabilities arise when untrusted data or a mutable object crosses an enforcement boundary without validation, isolation or correct sequencing. In the reported situation, allowing crafted input to change its WHERE clause. The effective mechanism is “SQL injection through unsafely constructed queries”: untrusted values alter SQL structure because the application fails to separate query logic from parameters.
The database query error involves application input handling, not virtualization isolation. The evidence is allowing crafted input to change its WHERE clause. Software vulnerabilities arise when untrusted data or a mutable object crosses an enforcement boundary without validation, isolation or correct sequencing. By contrast, “SQL injection through unsafely constructed queries” operates on the specific concern: untrusted values alter SQL structure because the application fails to separate query logic from parameters.
The demonstrated manipulation changes backend SQL selection, not client script execution. Browser and web-origin mechanisms affect one request path; the right diagnosis depends on whether the client or trusted server is performing the sensitive action. Here the decisive fact is allowing crafted input to change its WHERE clause. “SQL injection through unsafely constructed queries” matches that requirement because untrusted values alter SQL structure because the application fails to separate query logic from parameters.






CompTIA Security+ (SY0-701) Practice Tests