> 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/authentication/flawed-password-reset-logic.md).

# パスワードリセットにおける不備のあるロジック

パスワードリセットにおける不備のあるロジックの PortSwigger Web Security Academy ラボ向けノート。攻撃フロー、ペイロードテスト、Burp Suite による検証、および是正策の文脈を含みます。

### パスワードリセットの不具合ロジック

このラボでは、パスワードリセット機構に脆弱性があります。目的は、次のユーザーのパスワードをリセットすることです: **Carlos** その後、その「マイアカウント」ページにアクセスします。/ 提供された識別子:

* **wiener:peter**
* 被害者名: **carlos**

### 分析と手順

#### 1. パスワードを忘れた場合の機能

アプリケーションには「パスワードを忘れた場合」経由の回復機能があります。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ffa5f83b14077705c0d0769a86c877677f8796dd%2F%7B59329F4F-68B6-406A-80DC-7512DC57895F%7D.png?alt=media" alt="" width="436"><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-e7df7be39e21df89b1b2deff0bc8e8f1b407c0bf%2F%7BB0134D2A-71C9-4B46-A02F-ECE8D8E30759%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

#### 2. リセットメールの受信

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dc83ecdfc81bd0862f3da572e70e66ff8bf4d0e1%2F%7B94555F78-AEF9-48D4-908D-2A9C3A417138%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

メールアドレスを変更すると、リセットリンクを含むメッセージが送信されます。/ メールには一時的な **トークン** URL内に:

```http
送信日時:     2025-12-09 19:42:17 +0000
差出人:     "No reply" <no-reply@0ae200710383c04f868b0866005e0000.web-security-academy.net>
宛先:       wiener@exploit-0a46000003d9c0a086ee072901710023.exploit-server.net
件名:  アカウント復旧

こんにちは！

以下のリンクにアクセスしてパスワードをリセットしてください。

https://0ae200710383c04f868b0866005e0000.web-security-academy.net/forgot-password?temp-forgot-password-token=nec3070jgtmwcvnxt5b0ipmdh9746umj

よろしくお願いします。
サポートチーム
```

#### 3. フォームの送信

このリンクにアクセスすると、アプリケーションは新しいパスワードの入力を求めます。/ 送信されるパラメータは次のようなものです:

```bash
temp-forgot-password-token=nec3070jgtmwcvnxt5b0ipmdh9746umj
username=wiener
new-password-1=test
new-password-2=test
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1116ba483a2f759c50e46ed5c1159705a4e53abf%2F%7B77097069-21AA-454D-BBB7-62E13FB4B5EA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 4. 不具合ロジックの悪用

サーバーは確認しません **ない** トークンが実際にクエリで言及されたユーザーと一致していることを。/ 単にフィールドを置き換えます **username=wiener** を **username=carlos**:

```bash
temp-forgot-password-token=nec3070jgtmwcvnxt5b0ipmdh9746umj
username=carlos
new-password-1=test
new-password-2=test
```

アプリケーションはこれを受け入れるため、Carlos の新しいパスワードを設定できます。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2dfca4ea158f385e8c036227f052b500eb98faa3%2F%7BA10F3C95-2F8F-43BA-8B5C-BD7F82CF70C8%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/authentication/flawed-password-reset-logic.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.
