<!-- XE-17987 · OAuth callback completes sign-in without binding the state to the initiating browser (login CSRF) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-17987>. The page is the record; this is the same page for reading.*

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

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Minor

Area
:   Other

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-23 09:05 UTC

Told
:   2026-11-23 09:05 UTC

### Patches

None linked.

### History

- [807548](https://bounty.xe.network/log/807548) 2026-11-23 09:05 UTC proposal.adopted
- [807547](https://bounty.xe.network/log/807547) 2026-11-23 09:05 UTC reply.sent
- [807546](https://bounty.xe.network/log/807546) 2026-11-23 09:05 UTC ticket.status new → closed
- [805457](https://bounty.xe.network/log/805457) 2026-11-23 09:05 UTC proposal.adopted
- [805456](https://bounty.xe.network/log/805456) 2026-11-23 09:05 UTC ticket.facts area
- [805455](https://bounty.xe.network/log/805455) 2026-11-23 09:05 UTC proposal.adopted
- [805454](https://bounty.xe.network/log/805454) 2026-11-23 09:05 UTC ticket.facts
- [805453](https://bounty.xe.network/log/805453) 2026-11-23 09:05 UTC proposal.adopted
- [805452](https://bounty.xe.network/log/805452) 2026-11-23 09:05 UTC ticket.facts
- [803857](https://bounty.xe.network/log/803857) 2026-11-23 09:03 UTC note.added
- [803856](https://bounty.xe.network/log/803856) 2026-11-23 09:03 UTC proposal.created
- [803855](https://bounty.xe.network/log/803855) 2026-11-23 09:03 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-17987) · [JSON](https://bounty.xe.network/v1/tickets/XE-17987) · [markdown](https://bounty.xe.network/XE-17987.md)

### 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 Denne**team2026-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.
