[Bug]: Sign-in leaks which usernames exist

Aperta
#105 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Start at src/api/auth.rs:242 in the signIn resolver and follow the argon2 verification path, then read startPasskeySignIn at src/api/auth.rs:264 and the throttle branch at src/api/subsonic/mod.rs:215. Run the existing auth tests first to see how sign-in responses are asserted. Done means unknown and known usernames take comparable time and return the same shape on all three paths, with a test covering the unknown-user case.

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?
  • GraphQL signIn returns right away when the username doesn't exist, but runs argon2 when it does (src/api/auth.rs:242), so response time tells them apart.
  • startPasskeySignIn answers differently for "no such account"/"no passkeys" vs. an account with passkeys (src/api/auth.rs:264).
  • In the Subsonic API, unknown usernames spend a throttle guess while known ones using a token don't (src/api/subsonic/mod.rs:215).

With profiles sign-in on, the profile list already shows accounts, but with username sign-in these let anyone list them.

Steps to reproduce

Time signIn with an existing and a made-up username: the made-up one returns much faster.

Expected behavior

Unknown and known usernames take about the same time and get the same answers.

Suggested fix

Verify against a dummy argon2 hash when the account doesn't exist, return a passkey challenge with no allowed credentials (or the same error) for unknown accounts, and throttle the Subsonic paths the same way for both.

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.