Certified Ethical Hacker (CEH) — Question 6
During a penetration test, a tester finds that the web application being analyzed is vulnerable to Cross Site Scripting (XSS). Which of the following conditions must be met to exploit this vulnerability?
Answer options
- A. The web application does not have the secure flag set.
- B. The session cookies do not have the HttpOnly flag set.
- C. The victim user should not have an endpoint security solution.
- D. The victim's browser must have ActiveX technology enabled. B
Correct answer: B
Explanation
The correct answer is B because for an XSS attack to successfully steal session cookies, those cookies must not have the HttpOnly flag set, allowing JavaScript access. Option A is incorrect because the secure flag pertains to HTTPS connections, not XSS exploitation. Option C is not a requirement for exploiting XSS, as it can occur regardless of whether an endpoint security solution is in place. Option D is also false, as ActiveX is not necessary for XSS attacks, which can occur in modern browsers without it.