> 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/web-cache-deception/cheating-the-cache-with-delimiters-in-the-path.md).

# パス内の区切り文字を使ってキャッシュを欺く

PortSwigger Web Security Academy のラボ向けメモ。悪用の手順、ペイロードのテスト、Burp Suite による検証、修復の文脈を含む。

### Webキャッシュ欺瞞のためのパス区切り文字の悪用

#### 背景

**ラボ：** Webキャッシュ欺瞞のためのパス制限の操作 / **目的：** ユーザーから \*\*APIキー\*\* を取得する **carlos**. / **提供されたアクセス：** 〜との可能性のある関連 `wiener:peter`. / **ヘルプ：** 区切り文字の候補一覧はラボで提供されています。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7d2d25b19759891c924f495db86cec9b8731efcd%2F%7B1E6EFECE-A0F3-4DF6-9D0E-1A6EBE6482B1%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 初期観察

* で **マイアカウント** ページでは、自分のAPIキー\*\*をはっきり表示するサインが見えます。
* バックグラウンドでは、通常のアクセスがリクエストをトリガーします：

```bash
GET /my-account HTTP/2
```

この場合、 **応答はキャッシュから提供されません** （目に見える／解釈されるキャッシュ動作なし。）

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-166e3bc6025b41ab76cff764fc9c09a0de8b3b97%2F%7BE95ADD51-26B1-4D3C-A48F-3A6C758D04ED%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 区切り文字のテスト

* \*\*セミコロン\*\* を追加すると `;` パス内では、\*\*アプリケーションは依然としてルートを解釈します\*\* `my-account`、しかし今回は **キャッシュ動作を伴って**.

を使用する **Intruder**、いくつかの区切り文字を確認したところ、 **セミコロンが機能する**.

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-233c87ff615198c217cbd53a6ad57f98c19360fd%2F%7B8DFE85D2-8813-472D-AD26-0AB0AF4E77B9%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

有効なパスの例：

* `/my-account;test.js`

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-71b1b7ef57caa58a9faa5a3c6ea16f2bb9ef223e%2Fimage%20(80).png?alt=media" alt=""><figcaption></figcaption></figure>

#### 悪用

目的：被害者が罠URLにアクセスし、 **/my-account** 応答を\*\*キャッシュ\*\*させ、その後別のバリアントで再度読み込んで **carlos** データを取得する。

〜から**エクスプロイトサーバー**、被害者は次のURLにリダイレクトされます：

```javascript
<script>
    document.location="https://0a5e005c048218fb80a3f0ec00c2000d.web-security-academy.net/my-account/my-account;test.js";
</script>
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-40626dbcbbd1ff8d5619a793bc771da69b710f3f%2F%7BF05779E6-A4C1-45E9-BE49-3D311E98BCA0%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### APIキーの取得

* 次にURLを変更してアクセスします：
* `/my-account;jordan.js`

このレスポンスには次が含まれます **carlosのAPIキー**.

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7f21b64eb382c6456ce24a4bd1a5ba3f8f561123%2F%7B44422477-9CA3-462E-8C7E-951F71853DB6%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/web-cache-deception/cheating-the-cache-with-delimiters-in-the-path.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.
