[Bug]: Subsonic token logins and API keys aren't rate limited

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

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

評価

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

調査の方向性

src/api/subsonic/mod.rs の225行目あたりにある sign_in から始めます。ここではトークンの t/s 分岐と apiKey 分岐が throttle.guess を呼び出していません。すぐ上にある平文パスワードの分岐を読んで、既存の guess/right のパターンを確認し、両方の経路に適用してください。/rest/ping?u=<real user>&t=<random>&s=x を繰り返すと、最終的にエラー40が延々と返るのではなくスロットリングが返され、有効なトークンまたはキーでは state.throttle.right(ip) が呼び出されることが完了の条件です。報告者はサーバーを起動していないため、既存のSubsonicテスト構成で確認してください。

索引モデルが 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?

In the Subsonic API's sign_in, only plain-password attempts and unknown usernames spend a throttle guess. The t/s token path (src/api/subsonic/mod.rs:225) and the apiKey path never call throttle.guess, so app passwords and API keys can be guessed as fast as the server answers.

Steps to reproduce

Send /rest/ping?u=<real user>&t=<random>&s=x in a loop: every request gets error 40 and none get throttled.

Expected behavior

Wrong tokens and API keys spend a guess like wrong passwords do, and right ones give it back.

Suggested fix

Call state.throttle.guess(ip) before checking a token or API key and state.throttle.right(ip) when it matches.

主要言語
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 を短くまとめたダイジェスト。