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

# Отравление очереди с H2.TE

### Отравление очереди ответов через контрабанду запросов H2.TE

* Используйте уязвимость контрабанды запросов, чтобы отравить очередь ответов.
* Используйте это отравление, чтобы получить доступ к `/admin` панели администратора.
* Перехватите запрос администратора (а значит и его cookie сеанса), когда он подключится, затем удалите `carlos` пользователя.

#### Технический контекст

* Приложение принимает запросы **HTTP/2** со стороны фронтенда.
* Фронтенд **преобразует** эти запросы HTTP/2 в HTTP/1, даже когда длина неоднозначна.
* Атака основана на рассинхронизации типа **H2.TE**:
* Отправляет запрос HTTP/2, содержащий оба элемента:
* файл `Transfer-Encoding: chunked` заголовок
* файл `Content-Length` заголовок
* Соединение с бэкендом **сбрасывается каждые 10 запросов**:
* если соединение «сломано», просто отправьте несколько обычных запросов, чтобы вернуться к чистому соединению.
* В HTTP/2 вам не нужно задавать `Content-Length` обычно, что делает одновременное наличие `Transfer-Encoding` и `Content-Length` неоднозначным и пригодным к использованию.

#### Ход атаки

```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
```

* Часть HTTP/2 видна фронтенду, который преобразует её в HTTP/1 для бэкенда.
* Из-за неоднозначности `H2.TE`, бэкенд интерпретирует конец запроса по-другому.
* У `GET / HTTP/1.1` строка и следующие за ней **незаметно внедряются** как начало следующего запроса в строке бэкенда.

Мы **получить запрос отравленного администратора**, что позволяет нам получить: его **cookie сеанса**.

<figure><img src="/files/6f6eca4976285e614a9b68d5e7440a6e1e3779d5" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6ee6111672c09e7bee543028562b548faec89e6a" 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/ru/web/request-smuggling/queue-poisoning-with-h2-te.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.
