Bounty
XE-17987 · Bounty

OAuth callback completes sign-in without binding the state to the initiating browser (login CSRF)

Closed · duplicate —claimed Minor web filed 2026-11-18 03:17 UTC by xe:a2b14c2a

Report

Area: desk/api/reporter.py (OAuth callback flow)

Summary The OAuth state parameter is a random, single-use, 5-minute row, but it is never bound to the browser that started the flow. An attacker mints a state via GET /v1/reporter/auth/github, completes the GitHub authorization for their own account, and sends the victim the callback URL /v1/reporter/auth/github/callback?code=<attacker code>&state=<attacker state>. The victim's browser is then signed in as the attacker's reporter identity — classic login CSRF. Impact is bounded (the victim's subsequent filings are attributed to the attacker's account; the reverse direction — adding an identity to the victim's account — is correctly blocked by the link_to binding and the refusal to merge by email), but a victim may continue working unaware that reports, messages and reputation accrue to someone else's identity.

Evidence

  • desk/api/reporter.py:82-93 _oauth_state stores only next and link_to; no browser/session binding
  • desk/api/reporter.py:148-185 GitHub callback; desk/api/reporter.py:225-265 Discord callback — both trust any presented state
  • desk/api/reporter.py:128-136 _take_state guarantees single use, which also means the attacker's minted state is consumed by the victim's browser and cannot be reused for forensics
  • desk/api/reporter.py:139-145 _link_target and desk/api/reporter.py:280-282 / services/reporters.py:219-241 correctly block identity grafting and email merge (mitigations)

Preconditions The victim clicks an attacker-supplied callback URL within the 5-minute state window while not already holding a reporter session (or accepts replacing it when the state carries link_to — which an attacker cannot mint for a specific victim).

Fix Bind the state row to the initiating browser: set a short-lived nonce cookie (SameSite=Strict or Lax) at /auth/{github,discord} and require it to match the state row at the callback; alternatively store the initiating session id in the state row and require the same session at the callback.

Thread

Joseph Denneteam2026-11-23 09:05 UTCdesk

Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-17987 and says what differs; it is read like any other.