Secure Legion Labs
Reflected XSS Lab
This lab demonstrates a reflected XSS flow where a search-style interface reads user input from the URL and reflects it into the page. The goal is to move from a URL parameter into executable browser behavior through a weak filter.
This lab reads input from ?q= and reflects it back into the page. Use the console below or edit the URL directly.
?q=your_input_here?q=payload_hereThe filter removes broad script references and replaces the word alert. It looks defensive but still leaves a practical bypass route.
replace(/script/gi, "")
replace(/alert/gi, "blocked")Use the internal console to test payloads and sync them into the current page URL.
?q=The search result is written into innerHTML and mirrored in a debug line as a second reflection point.
Status: waiting for query input.
Once you trigger the right execution path, the flag appears here.
Submit the exact flag to unlock the completion modal and continue to the next room.
Flag is locked until you trigger the challenge condition.
The page pulls attacker-controlled data from ?q=.
Only a few obvious patterns are changed, which creates false confidence.
The resulting string is rendered as HTML, which creates execution paths.