ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 337 - CS0-003 discussion

Report
Export

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?

A.

Deploy a wireless application protocol.

Answers
A.

Deploy a wireless application protocol.

B.

Remove the end-of-life component.

Answers
B.

Remove the end-of-life component.

C.

Implement proper access control.

Answers
C.

Implement proper access control.

D.

Validate user input.

Answers
D.

Validate user input.

Suggested answer: D

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. This is a key principle from CompTIA Security+ guidelines on secure coding practices. Options A and B are unrelated to the vulnerability type here, and while access control (Option C) is generally good practice, it does not specifically prevent SQL injection.

asked 17/10/2024
marek kus
30 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first