Reflected XSS

Non-persistent XSS where the payload travels in the request (query string, path, header, or body) and is echoed into the immediate response, so exploitation requires luring the victim to an attacker-crafted URL or form submission.

How it works

Input from a single request is reflected into the response unescaped. The injection point determines the breakout:

  • HTML body — inject a tag directly: <script>…</script>, or <svg onload=…> where script tags are stripped.
  • Tag attribute — close the attribute/tag: "><svg onload=…> or stay inside and add a handler: " autofocus onfocus=alert(1) x=".
  • JavaScript string — break the string/statement: '-alert(1)-', </script><svg onload=…>.
  • URL/href — javascript: scheme, exploitable in <a href>, location sinks.

Because the payload isn’t stored, delivery is social: a link in email/chat, a malicious form that auto-submits, or an open-redirect/referer chain. Reflected XSS in a GET parameter is the classic one-click. Many “reflected” bugs are actually reflected-DOM-Based XSS where the reflection is written back by client JS.

Techniques / payloads

Methodology (three steps): find a reflection point, identify the context by injecting canary chars ('"<> and seeing which survive), craft the context-appropriate breakout.

  • Context probing: submit kq9z'">< and inspect which characters are encoded. Encoded </> but raw " → attribute-only injection.
  • Attribute without tag breakout: " onmouseover="alert(1) / " autofocus onfocus="alert(1).
  • Tags blocked except custom ones: use a custom element plus onfocus+tabindex and an auto-trigger, e.g. <xss id=x onfocus=alert(1) tabindex=1></xss>#x (hash navigation auto-focuses).
  • JS-string context: </script> to escape, or close the string and use the comma operator.
  • When a WAF intercepts, pivot to XSS Filter Bypasses.
  • Testing: Burp Repeater against a unique marker to find reflecting requests; confirm execution, not just reflection.

Notable cases

Reflected XSS in enterprise edge/gateway products is actively exploited for credential phishing and session theft:

  • Siemens Teamcenter login redirect (CVE-2026-58113) — reflected XSS in the login redirect parameter, weaponized by Bishop Fox to harvest credentials against the SSO flow.
  • PAN-OS GlobalProtect (CVE-2025-0133) — reflected XSS in the GlobalProtect gateway/portal; risk amplified when Clientless VPN is enabled.
  • Citrix NetScaler (CVE-2025-12101) — reflected XSS in the SAML RelayState parameter (watchTowr analysis).
  • Cisco IOS XE Web UI, Kubeflow Pipelines (CVE-2026-88986, untrusted pod names/namespaces reflected in /pipeline/k8s/pod error JSON), GotoHTTP (CVE-2026-13536, sn param) — all unauthenticated reflected XSS.
  • Amazon.com reflected client XSS — cookie theft across Amazon domains with redirect-to-phishing.

Defenses

  • Contextual output encoding at the sink (HTML-entity, attribute, JS-string, URL) — framework auto-escaping covers the HTML-body case but not raw attribute/URL/JS contexts.
  • Never reflect request parameters (including redirect/RelayState/error-echoed identifiers) into responses without encoding.
  • Defense-in-depth: Content Security Policy, HttpOnly cookies so a fired payload can’t read the session.

Sources