[Bug]: Changing your password doesn't sign out other sessions

オープン 初心者向け
#108 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust

調査の方向性

src/api/auth.rs:314のchangePasswordから始め、パスワードリセットと管理者によるリセットの各処理でセッションを削除するコードを読み、参考にするパターンを確認してください。パスワードハッシュを更新した後、現在のセッションのトークンとtoken_hashが異なる、そのユーザーの行をsessionsテーブルから削除し、呼び出し元のユーザーはサインインしたままにします。2つのクライアントでサインインし、一方でパスワードを変更して、もう一方が拒否されることを確認して検証してください。issueにはコードを読んでこの問題が見つかったとあるため、修正を信頼する前に再現してください。

索引モデルが issue の本文から書いたものです。

説明

bug

[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.

Version

0.40.0 (feat/desktop, 017a837b)

Area

Other

What happened?

changePassword updates the hash but leaves every other session alive (src/api/auth.rs:314). A password reset and an admin changing someone's password both delete sessions, so the one path a user takes when they think they're compromised is the one that keeps a stolen session working.

Steps to reproduce
  1. Sign in on two browsers.
  2. Change the password in one.
  3. The other is still signed in.
Expected behavior

Every session except the current one is signed out.

Suggested fix

DELETE FROM sessions WHERE user_id = ? AND token_hash != ? with the current token's hash after updating the password.

主要言語
TypeScript
スター
4
フォーク
1
平均マージ
4時間 49分
マージ済み PR(30日)
5

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tinystream-dev/tinystream のほかの issue

tinystream-dev/tinystream の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。