September 3, 2026
Portswigger XSS Lab : Reflected XSS into HTML context with nothing encoded — Writup
بسم الله والصلاه والسلام علي رسول الله صلي الله عليه وسلم
By Elkholeyahmed
1 min read
In this lab, we're going to solve a simple Reflected XSS challenge.
What is Reflected XSS ?
Reflected XSS occurs when user input is immediately reflected in the HTTP response without proper sanitization or encoding. Reflected Cross-Site attacks also known as non-persistent attacks, occur when a malicious script is reflected off of a web application to the victim's browser.
How it works ?
# Malicious Input: An attacker crafts a malicious URL or form submission containing a script and sends it to a victim, often through phishing emails or social media.
# User Clicks: user clicks the link, which sends a request to a vulnerable web application.
# Reflected Response: A vulnerable web application receives this input and, without proper sanitization or encoding, includes it directly in the response sent back to the user.
Access the lab
We are looking for any injectable inputs, and here we found 'search'.
First, we type something — like "Hello" — to see where it appears in the HTML code.
We wrote a simple tag
hello
We observed that the site treated the tag as executable code and failed to filter it; this indicated that the site was vulnerable to HTML injection.
Let's try an XSS injection.
A pop-up alert should now appear
Congratulations! You have just solved the first XSS lab!
Thanks For Reading