> 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/web/request-smuggling/queue-poisoning-with-h2-te.md).

# Queue Poisoning with H2.TE

Queue Poisoning with H2.TE notes for PortSwigger Web Security Academy labs, including exploitation workflow, payload testing, Burp Suite validation, and remediation context.

### Response Queue Poisoning via H2.TE Request Smuggling

* Take advantage of request smuggling vulnerability to poison the response queue.
* Use this poisoning to access the `/admin` administration panel.
* Recover the admin query (and thus its session cookie) when it connects, then delete the `carlos` user.

#### Technical Context

* The application accepts requests **HTTP/2** front-end side.
* The front-end **downgrades** these HTTP/2 requests to HTTP/1, even when the length is ambiguous.
* The attack is based on unsynchronization of type **H2.TE**:
* Sends an HTTP/2 query containing both:
* a `Transfer-Encoding: chunked` header
* a `Content-Length` header
* The connection to the back-end is **reset every 10 requests**:
* if the connection is "broken", just send a few normal requests to go back to a clean connection.
* In HTTP/2, you do not need to define `Content-Length` normally, which makes the simultaneous presence of `Transfer-Encoding` and `Content-Length` ambiguous and usable.

#### Motion for Attack

```http
POST / HTTP/2
Host: 0afc007a0423d9b980403f2c00dd00d7.web-security-academy.net
Transfer-Encoding: chunked
Content-Length: 120

0

GET / HTTP/1.1
Host: 0afc007a0423d9b980403f2c00dd00d7.web-security-academy.net
Content-Length: 12

testing=test
```

* The HTTP/2 part is seen by the front-end, which converts it to HTTP/1 for the back-end.
* Because of the ambiguity `H2.TE`, the back-end interprets the end of the request differently.
* The `GET / HTTP/1.1` line and the following are **furtively injected** as the start of the next query in the back-end line.

We **retrieve the request for poisoned admin**, which allows us to get: its **session cookie**.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f8cb9656f46ad61c65345f4030871c2a00e0f9c3%2F%7B606041C0-7B5F-4BC8-A64C-6FCDB7449828%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ce994d5a72a05bd41fe1b2696e392f6acffc2e70%2F%7B856ABF65-A462-44BA-827E-E044AB503A36%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/web/request-smuggling/queue-poisoning-with-h2-te.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.
