{"id":"XE-1799","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":451,"title":"`set_award` accepts awards on non-bounty tickets, and Discord `/bounty` converts them to bounty tickets — bypassing the XE-0789 guard the web route enforces","area":"other","claimed_tier":"minor","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-09T04:37:07.816551+00:00","updated_at":"2026-11-14T22:57:04.296924+00:00","source_created_at":null,"told_at":"2026-11-10T14:00:35.176885+00:00","status_changed_at":"2026-11-10T14:00:33.494292+00:00","url":"https://bounty.xe.network/XE-1799","body":"## Summary\r\n\r\n`desk/services/tickets.py:949` `set_award` checks amount, ceiling,\r\nand approval-change only — no kind or status check.\r\n`desk/api/team.py:185-191` (the `award` route) adds only the `award`\r\npermission check, no kind check. So a treasurer can put an award on a\r\nsupport ticket. Then `desk/services/channels.py:231`\r\n`convert_to_bounty` — whose only 409 is \"already a bounty ticket\", with\r\nno award/status check — converts it to a bounty ticket with the award\r\nintact. The web route `set_kind` (`desk/api/team.py:118-140`) blocks\r\nexactly this conversion with 409 when `t.award_xe or\r\nt.award_approved_at or t.status in settled` (XE-0789). Discord\r\n`/bounty` (`desk/bots/discord_bot.py:364-372`, team-role gated via\r\n`need_team`) calls `convert_to_bounty` then commits — the bypass.\r\n\r\n## Impact\r\n\r\n- **Awarded support ticket becomes a bounty ticket.** The converted\r\n  ticket can then travel the full bounty pipeline toward payment —\r\n  which is what XE-0789 was meant to prevent.\r\n- **Scope limit (stated plainly).** Needs a treasurer (to award) AND\r\n  a team-role Discord user (to convert). No direct payout: the award\r\n  still needs approval on a patched/disclosed ticket, and `mark_paid`\r\n  needs `awarded` status. Privileged actors only, and the bypass is of\r\n  a guard, not of the payment checks themselves.\r\n\r\n## Severity reasoning\r\n\r\n- **Minor, not Low:** two privileged actors are needed and the payment\r\n  checks still stand, so the practical harm is a guard bypass that\r\n  lets a wrong-kind ticket enter the bounty pipeline — not a direct\r\n  payout. Minor is honest for a privileged-actor guard bypass with no\r\n  direct fund path.\r\n\r\n## Root cause\r\n\r\nThe kind/status floor exists in exactly one place (`set_kind`, the web\r\nroute) instead of in the shared service functions (`set_award`,\r\n`convert_to_bounty`), so the Discord path — which calls the services\r\n  directly — never sees it.\r\n\r\n## Reproduction\r\n\r\n### A. Python harness (primary evidence — PASS)\r\n\r\nHarness `/tmp/desk4/h1_sqlite.py` (real SQLite DB, real service code\r\n+ real team route for the contrast). `set_award` on a `new` support\r\nticket set `award_xe=1_000_000` with no error; `convert_to_bounty`\r\nflipped it to `kind=bounty` with the award intact; the identical\r\nconversion via the team route raised HTTP 409 (\"a new ticket with a\r\nbounty record is not converted; close it\"). Harness prints `BUG\r\nCONFIRMED`.\r\n\r\n## Dedup note\r\n\r\nChecked against the live public report list at https://bounty.xe.network\r\n(166 public tickets, checked 2026-11-09). XE-0789 is the in-repo\r\nreference for the `set_kind` guard itself; this report is about the\r\ntwo paths that bypass it (`set_award` with no kind floor, and Discord\r\n`/bounty` → `convert_to_bounty`). No known report covers the bypass.\r\n\r\n## Suggested fix direction\r\n\r\n- Add the kind/status floor to `set_award` (refuse awards on\r\n  non-bounty tickets) and to `convert_to_bounty` (refuse conversion\r\n  when `award_xe` / `award_approved_at` is set or status is settled),\r\n  so every entry point enforces the XE-0789 rule, not just the web\r\n  route.\r\n\r\n## References (file:line, desk @ 186af22)\r\n\r\n| Location | What it shows |\r\n|---|---|\r\n| `desk/services/tickets.py:949` (`set_award`) | Amount/ceiling/approval checks only; no kind or status check |\r\n| `desk/api/team.py:185-191` (`award` route) | Permission check only; no kind check |\r\n| `desk/services/channels.py:231` (`convert_to_bounty`) | Only 409 is \"already a bounty ticket\" |\r\n| `desk/api/team.py:118-140` (`set_kind`) | Blocks the same conversion with 409 (XE-0789) |\r\n| `desk/bots/discord_bot.py:364-372` (`/bounty`) | Team-role gated; calls `convert_to_bounty` then commits |\r\n| `/tmp/desk4/h1_sqlite.py` | Verification harness (`BUG CONFIRMED`) |\r\n\r\n## Payout address\r\n\r\n```\r\n052e33e0ed9c43e2bdf07faff9a90d25642b51d53d96f49f5d45b81f6584b3da\r\n```\r\n\r\n**NOTE — operator must confirm this payout address (or replace it with\r\ntheir own) before submission.** This is the hunt testnet wallet generated\r\nfor faucet/PoC work; it is the address the reporter intends to receive\r\nany award at, pending operator confirmation.","patch_refs":[],"thread":[{"id":2138,"source":"desk","source_ref":"reply:1505","author":"Joseph Denne","team":true,"body":"Thank you for this report. We have read it against the code and it is being handled. The assessment and any award follow the fix. https://bounty.xe.network/XE-1799","created_at":"2026-11-10T14:00:19.792775+00:00"}]}