[Bug]: Sign-in leaks which usernames exist

Open
#105 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
graphql, rust

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
4
Forks
1
Avg merge
4h 49m
Merged PRs (30d)
5

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tinystream-dev/tinystream

All issues in tinystream-dev/tinystream

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.