{"id":"XE-17987","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2260,"title":"OAuth callback completes sign-in without binding the state to the initiating browser (login CSRF)","area":"other","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-18T03:17:51.322383+00:00","updated_at":"2026-11-23T09:05:28.618016+00:00","source_created_at":null,"told_at":"2026-11-23T09:05:28.628228+00:00","status_changed_at":"2026-11-23T09:05:28.621471+00:00","url":"https://bounty.xe.network/XE-17987","body":"Area: desk/api/reporter.py (OAuth callback flow)\n\nSummary\nThe 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.\n\nEvidence\n- desk/api/reporter.py:82-93 `_oauth_state` stores only `next` and `link_to`; no browser/session binding\n- desk/api/reporter.py:148-185 GitHub callback; desk/api/reporter.py:225-265 Discord callback — both trust any presented state\n- 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\n- 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)\n\nPreconditions\nThe 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).\n\nFix\nBind 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.","patch_refs":[],"thread":[{"id":19732,"source":"desk","source_ref":"reply:17398","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-17987 and says what differs; it is read like any other.","created_at":"2026-11-23T09:05:28.618016+00:00"}]}