{"id":"XE-0656","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":202,"title":"[Desk] Reporter sign-in is not bound to the browser that started it: login CSRF signs a victim's browser into an attacker-chosen reporter identity (High)","area":"other","claimed_tier":"high","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-05T09:47:28.163665+00:00","updated_at":"2026-11-05T22:10:16.340940+00:00","source_created_at":null,"told_at":"2026-11-05T22:10:16.608262+00:00","status_changed_at":"2026-11-05T22:10:16.579663+00:00","url":"https://bounty.xe.network/XE-0656","body":"# [Desk] Reporter sign-in is not bound to the browser that started it (High)\n\n**Repo pin:** `xeprotocol/desk` master @ 2026-11-04. The desk is explicitly in scope per\nbounty.xe.network/scope (\"This desk is in scope for the bounty from the day it went public\").\n**CWE:** CWE-352 (CSRF) — session establishment. **CVSS 3.1:** 8.6 High —\n`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`. **Suggested tier:** High (10,000 XE).\n**PoC status:** mechanism verified line-by-line in source; the OAuth variant needs two browsers\nagainst the live desk — not executed.\n\n## XE-NEW-10 — Reporter sign-in is not bound to the browser that started it: login CSRF signs a victim's browser into an attacker-chosen reporter identity (High, desk)\n\n**Component:** `desk/api/reporter.py:317-329` (`xe_login`), `desk/api/reporter.py:108-158`\n(`github_callback`), `desk/api/reporter.py:199-243` (`discord_callback`), `desk/api/reporter.py:56-60`\n(`_sign_in`), `desk/auth.py:120-130` (`set_session_cookie`, SameSite=Lax)\n**CWE:** CWE-352 (CSRF) — session establishment. **CVSS:** 8.6 High —\n`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N` (victim must visit an attacker page; the payoff is\nthe attacker reading the victim's sealed Critical/Severe report and payout address).\n**Suggested tier:** High (10,000 XE). **PoC status:** mechanism verified in source; the OAuth\nvariant needs two browsers (attacker + victim) against the live desk — not executed.\n\n**Mechanism.** Every other reporter route that changes identity goes through\n`_reporter(who, request)`, which enforces `X-Desk-CSRF` (`bind_payout` at :331, `email_start` at\n:284, `email_finish` at :295). `xe_login` is the exception: a POST that takes an\nattacker-suppliable `SignedRequest` under `xe/desk/login/v1` and ends in `_sign_in`, which sets the\n`desk_reporter` cookie — with no CSRF token. The OAuth callbacks are GETs that accept any `state`\nfrom any browser: the `Challenge` row is deleted on first use but is never tied to the browser that\ncreated it (no cookie, no PKCE verifier, no nonce), and `discord_start` uses `prompt=none` so\nDiscord re-authorises silently. `_link_target` (:108-115) refuses only the **merge** direction when\nthe callback browser is not the one that asked; it does nothing about the **sign-in** direction.\n`auth.verify_signed`'s single-use `seen_signatures` row is the only cost, and the attacker holds\nthe key, so one fresh signature per victim is free.\n\nTwo triggers, same outcome:\n1. A cross-site form POST (`mode:no-cors`, `text/plain` JSON body, which FastAPI still parses) of a\n   fresh SignedRequest to `/v1/reporter/auth/xe` from the victim's browser. The response's\n   Set-Cookie (SameSite=Lax — Lax restricts *sending* on cross-site subrequests, not *setting*) is\n   stored, so the victim's browser now holds the attacker's reporter session.\n2. The attacker starts GitHub/Discord OAuth (signed out, `link_to=None`) and sends the victim's\n   browser the callback URL with their code+state. The victim's browser completes the flow and is\n   signed in as the attacker's GitHub/Discord identity.\n\n**Impact.** The victim's browser is silently signed in as an attacker-controlled reporter. Any\nprivate report the victim then files — Critical/Severe reports are private by default, body and\nattachments sealed with the vault key — is attached to the attacker's reporter row. The attacker\nreads the sealed body through `GET /v1/tickets/{id}` and `/my`, sees the payout address via\n`read:payout_address`, and the award/paid flow pays them. This is the exact asset the desk exists\nto protect (sealed reports + payout binding), taken without touching the victim's account.\n\n**Dedup.** Distinct from XE-0253, which is the merge direction (`from_platform`/`from_github` with\n`link_to`) — `_link_target` already guards that path. This is the sign-in direction, which nothing\nguards. No other dedup entry covers reporter session establishment.\n\n**Fix.** Require the CSRF token on `xe_login` like every other identity-changing route, and bind\nthe OAuth `state` to the initiating browser (a nonce in a short-lived cookie checked at callback),\nso a state handed to another browser is a plain sign-in there — never a session for someone else.\n\n---","patch_refs":[],"thread":[{"id":415,"source":"desk","source_ref":"reply:142","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0302, 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, reply with what differs and we will look again.","created_at":"2026-11-05T22:10:16.340940+00:00"}]}