nerdexam
CompTIA

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…

Submitted by diego_uy· Mar 6, 2026Vulnerability Management

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)
  • A
    7% (2)
  • B
    18% (5)
  • C
    4% (1)
  • D
    71% (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

#SQL injection#input validation#web application security

Community Discussion

No community discussion yet for this question.

Full CS0-003 Practice