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

Aperta Adatta ai principianti
#104 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Inizia da sign_in in src/api/subsonic/mod.rs (intorno alla riga 225), dove il ramo del token t/s e quello di apiKey saltano throttle.guess. Leggi il ramo della password in chiaro subito sopra per vedere il pattern esistente guess/right, poi applicalo a entrambi i percorsi. Il lavoro è completo quando un ciclo di /rest/ping?u=<real user>&t=<random>&s=x restituisce infine la limitazione delle richieste invece dell’errore 40 senza fine e un token o una chiave validi chiamano state.throttle.right(ip). Nota che chi ha segnalato il problema non ha avviato un server, quindi verifica con la configurazione di test Subsonic esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
4
Fork
1
Merge medio
4h 49m
PR unite (30g)
5

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tinystream-dev/tinystream

Tutte le issue di tinystream-dev/tinystream

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.