PortSwigger

Description
This lab has a simple reflected XSS vulnerability. The site is blocking common tags but misses some SVG tags and events. To solve the lab, perform a cross-site scripting attack that calls the alert() function.
Solution Steps
Step 1: Indentify the Vulneraility
Test standard XSS vector:
<script>alert(1)</script>
- Result: Gets blocked (400 response)

Step 2: Identify Allowed Tags (Burp Intruder)
- Send the search request to Burp Intruder
- Replace the search term with:
<> - Add payload position:
<§§>(cursor between angle brackets) - From XSS cheat sheet, copy tags to clipboard

- Paste tags into payloads list
- Start attack
Results:
- Most payloads →
400response (blocked) - Allowed tags (200 response)

Step 3: Identify Allowed Attributes (Burp Intruder)
- Replace search term with:
<svg><animatetransform%20=1>(animatetrannsformissvgrelated tag) - Add payload position:
<svg><animatetransform%20§§=1>(before=) - From XSS cheat sheet, copy events to clipboard
- Clear previous payloads and paste events

- Start attack
Results:
- Most payloads →
400response (blocked) onbeginattribute →200response (allowed!)
Step 4: Construct the Payload
Now we know:
- Allowed tag:
<svg>and<animatetransform> - Allowed event:
onbegin
Final payload:
<svg><animatetransform onbegin=alert(1)>

- Enter the payload into search box and Click Search button
Step 6: Solve the Lab
Once the alert appears, the lab is marked as Solved.


How the Payload Works
| Part | Purpose |
|---|---|
" | Closes any existing attribute |
> | Closes any existing tag |
<svg> | Starts an SVG element (allowed) |
<animatetransform> | SVG animation tag (allowed) |
onbegin=alert(1) | Event that fires when animation begins |
> | Closes the tag |