Target Briefing: Apex Search Engine
You are auditing the internal knowledgebase search engine of Apex Cloud Systems.
The developers recently migrated from server-side templates to a client-side Single Page Application (SPA).
During code review, security analysts flagged that the search term is parsed directly from the browser's location.hash and written into the results DOM using an unescaped sink:
document.getElementById('resultsQuery').innerHTML = decodeURIComponent(location.hash.slice(1));
Your Objective:
- Craft a DOM-based XSS payload that successfully invokes
alert(1) or alert(document.domain) in the target window.
- Once executed, the built-in watchdog sensor will verify payload execution and reveal the mission flag.
- Inspect how the hash is extracted:
#query_here.
- Standard <script> tags inserted via innerHTML may not execute in modern browsers. Try an HTML5 image or SVG payload:
<img src=x onerror=alert(1)>.