
EC-CouncilWeb Application Hacking and Security
Domain 3Objective 3
DOM-based XSS WAHS Practice Questions (Page 2)
Part of the Cross-Site Scripting (XSS) domain, which makes up ~11% of our current practice bank. EC-Council does not publish an official question count, but from its 360-minute exam (~145–240 total, ~16–26 in this domain), expect 5–9 from this objective — we provide 32 practice questions to prepare you well beyond it. (estimate)
32questions here
7free pages
7concepts
Questions 6–10
- 6
A developer is fixing a DOM-based XSS vulnerability where untrusted data from location.search is used in an element's innerHTML. The developer proposes the following fix: var encoded = encodeURIComponent(userInput); element.innerHTML = encoded;. Is this fix effective?
Select an answer first - 7
A development team is hardening a large legacy application against DOM-based XSS. The application has many instances of unsafe sinks like innerHTML and document.write. The team has a limited budget and must choose a single mitigation that provides the broadest protection across all sinks. Which approach is the most effective given the constraint?
Select an answer first - 8
A security engineer is analyzing a complex single-page application. The application has a client-side router that reads the URL path and renders different views. The engineer suspects a DOM-based XSS vulnerability where the path is used in a template that is inserted into the DOM. The engineer has confirmed that the path is not sent to the server. Which statement best describes the challenge of detecting this vulnerability and the most effective detection method?
Select an answer first - 9
A company's customer portal has a DOM-based XSS vulnerability that can be triggered by a crafted link. An attacker sends a phishing email with a malicious link to a logged-in customer. The payload steals the session cookie and sends it to an attacker-controlled server. Which statement best describes the full impact of this attack?
Select an answer first - 10
Consider the following JavaScript code: ``` var name = location.hash.substring(1); document.getElementById('greeting').innerHTML = 'Hello, ' + name; ``` What is the data flow from source to sink?
Select an answer first
Finished these 5 questions?
Review the revealed explanations, or continue through the curriculum.
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by EC-Council. “WAHS” is a trademark of its owner, used for identification only.