CS0-003 · Question #445
K company has recently experienced a security breach via a public-facing service. Analysis of the event on the server was traced back to the following piece of code: SELECT ' From userjdata WHERE…
The correct answer is D. Validate user input. The code snippet provided suggests an SQL injection vulnerability, indicated by the use of "1=1," which is a common SQL injection technique to bypass authentication. To mitigate this risk, validating user input is the most effective control, as it ensures that any input is…
Question
K company has recently experienced a security breach via a public-facing service. Analysis of the event on the server was traced back to the following piece of code:
SELECT ' From userjdata WHERE Username = 0 and userid8 1 or 1=1;-- Which of the following controls would be best to implement?
Options
- ADeploy a wireless application protocol.
- BRemove the end-of-life component.
- CImplement proper access control.
- DValidate user input.
How the community answered
(28 responses)- A7% (2)
- B18% (5)
- C4% (1)
- D71% (20)
Explanation
The code snippet provided suggests an SQL injection vulnerability, indicated by the use of "1=1," which is a common SQL injection technique to bypass authentication. To mitigate this risk, validating user input is the most effective control, as it ensures that any input is properly sanitized and escapes potentially malicious characters before interacting with the database.
Topics
Community Discussion
No community discussion yet for this question.