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

# Envenenamiento de cola con H2.TE

### Envenenamiento de la cola de respuestas mediante contrabando de solicitudes H2.TE

* Aprovecha una vulnerabilidad de contrabando de solicitudes para envenenar la cola de respuestas.
* Usa este envenenamiento para acceder al `/admin` panel de administración.
* Recupera la solicitud del administrador (y, por tanto, su cookie de sesión) cuando se conecte, y luego elimina la `carlos` usuario.

#### Contexto técnico

* La aplicación acepta solicitudes **HTTP/2** del lado del front-end.
* El front-end **degrada** estas solicitudes HTTP/2 a HTTP/1, incluso cuando la longitud es ambigua.
* El ataque se basa en una desincronización de tipo **H2.TE**:
* Envía una solicitud HTTP/2 que contiene ambas:
* un `Transfer-Encoding: chunked` encabezado
* un `Content-Length` encabezado
* La conexión con el back-end se **reinicia cada 10 solicitudes**:
* si la conexión está "rota", simplemente envía unas cuantas solicitudes normales para volver a una conexión limpia.
* En HTTP/2, no necesitas definir `Content-Length` normalmente, lo que hace que la presencia simultánea de `Transfer-Encoding` y `Content-Length` sea ambigua y utilizable.

#### Plan de ataque

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

* La parte HTTP/2 la ve el front-end, que la convierte a HTTP/1 para el back-end.
* Debido a la ambigüedad `H2.TE`, el back-end interpreta el final de la solicitud de manera diferente.
* El `GET / HTTP/1.1` la línea y las siguientes son **inyectados furtivamente** como el inicio de la siguiente solicitud en la línea del back-end.

Nosotros **recuperar la solicitud del administrador envenenado**, lo que nos permite obtener: su **cookie de sesión**.

<figure><img src="/files/38d40eb3036de0b343908f18726812b07fbcf798" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6b9831503f6d4d7b3bebfbbf8b140e22575ec8a9" 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/es/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.
