{"id":"XE-0604","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":242,"title":"ticket.award events publish the held assessed_tier: the public log discloses a severity the ticket API withholds, nine events after ticket.facts redacts it","area":"other","claimed_tier":"medium","assessed_tier":"minor","verdict":"valid","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"awarded","closed_reason":null,"github_state":"","disclosed_at":"2026-11-09T21:02:14.175551+00:00","award_xe":50000000,"award_approved":true,"paid_ref":"","created_at":"2026-11-05T06:13:47.322588+00:00","updated_at":"2026-11-09T21:02:13.959020+00:00","source_created_at":null,"told_at":"2026-11-08T21:28:36.030410+00:00","status_changed_at":"2026-11-09T21:02:14.197789+00:00","url":"https://bounty.xe.network/XE-0604","body":"## Component and version\r\n\r\nThe bounty desk, `bounty.xe.network`, source `github.com/xeprotocol/desk`.\r\n\r\n- HEAD at review: `14c35b8ecadb06d4b4eb4fd98e4db62f39a5dcd9` (2026-11-05 04:44:42 UTC)\r\n- The control this report is about was introduced by `f323a99511d8e08b912618978cb595db3d164ffe`\r\n  (\"publish the assessment with the fix, not before\"), 2026-11-05 04:40:38 UTC.\r\n- Live deployment confirmed as `network.id = testnet-0005`, `version 0.1.0`\r\n  via `GET https://bounty.xe.network/v1`.\r\n\r\nMethod: static source review plus read-only unauthenticated HTTP GETs against the live\r\ndesk. No credentials were used. Nothing was written. No other user's data was touched.\r\n\r\n## Summary\r\n\r\n`f323a99` introduced a hold on the team's assessment of an open bug. While a bounty\r\nticket sits in `new`, `triaging`, `needs-info`, `accepted` or `fixing`, `assessed_tier`,\r\n`verdict`, `mainnet_gate`, `effort_eng` and `internal_ref` are withheld from readers\r\noutside the team and its agents.\r\n\r\nThe hold is enforced on two paths and missed on a third.\r\n\r\n`desk/services/tickets.py:754,767` — the ticket serializer gates the field:\r\n\r\n    full = sees_assessment(p)\r\n    shown = full or not assessment_held(t)\r\n    ...\r\n    \"assessed_tier\": t.assessed_tier if shown else None,\r\n\r\n`desk/log.py:269-274,294-306` — the log serializer strips it out of `ticket.facts`\r\npayloads:\r\n\r\n    HELD_FACT_KEYS = frozenset({\"assessed_tier\", \"verdict\", \"mainnet_gate\", \"effort_eng\", \"internal_ref\"})\r\n    HELD_PAYLOAD_KEYS = {\r\n        \"ticket.facts\": frozenset({\"reason\"}),\r\n        \"ticket.status\": frozenset({\"reason\"}),\r\n        \"proposal.created\": frozenset({\"value\"}),\r\n    }\r\n    ...\r\n    def public_payload(kind, payload):\r\n        drop = TEAM_ONLY_KEYS | HELD_PAYLOAD_KEYS.get(kind, frozenset())\r\n        out = {k: v for k, v in payload.items() if k not in drop}\r\n        if kind == \"ticket.facts\" and isinstance(out.get(\"changes\"), dict):\r\n            kept = {k: v for k, v in out[\"changes\"].items() if k not in HELD_FACT_KEYS}\r\n            ...\r\n\r\n`desk/services/tickets.py:727-739` — the third path, `set_award()`, writes the same\r\nvalue into a `ticket.award` event under the key `tier`, and `ticket.award` has no entry\r\nin `HELD_PAYLOAD_KEYS`:\r\n\r\n    await ctx.events.append(\r\n        db,\r\n        \"ticket.award\",\r\n        p.actor,\r\n        {\r\n            \"ticket\": t.id,\r\n            \"award_xe\": t.award_xe,\r\n            \"approved\": bool(t.award_approved_at),\r\n            \"tier\": t.assessed_tier,        # <- line 735: the held field, under a different key name\r\n        },\r\n        ref=t.id,\r\n        public=t.visibility == \"public\",\r\n    )\r\n\r\nBecause the denylist is keyed on `(kind, payload key)` and this event uses the key\r\n`tier` rather than `assessed_tier`, `public_payload()` passes it through untouched. The\r\nevent is written with `public=True` for every public-visibility ticket and is served to\r\nanonymous readers by `GET /v1/log`, `GET /v1/log?ref=<ticket>`, `GET /v1/log/{index}`,\r\n`GET /v1/events` and `GET /v1/events/stream`.\r\n\r\nThe result is that the desk redacts the assessment in one event and publishes it in\r\nanother, on the same ticket, in the same log stream, a few indices apart.\r\n\r\n## What I did\r\n\r\n1. Read `f323a99` and enumerated the three serialization paths for `assessed_tier`\r\n   (`to_dict`, `public_payload`/`ticket.facts`, `set_award`/`ticket.award`).\r\n2. Paged the anonymous public log: `GET /v1/log?offset=0&limit=1000` and\r\n   `?offset=1000&limit=1000` — 1,710 events, no credentials.\r\n3. Collected every `ticket.award` event (12 of them).\r\n4. For each, requested the public ticket endpoint `GET /v1/tickets/{id}` and compared\r\n   the `tier` in the log payload against `assessed_tier` in the ticket response, plus\r\n   the ticket's `status` against `ASSESSMENT_HELD`.\r\n5. Saved the whole cross-check as `poc_evidence.json`; the runnable script is\r\n   `poc_desk_public_log_leak.py`.\r\n\r\n## What happened\r\n\r\nTwo live tickets currently disclose a held assessment. Verbatim from the run at\r\n2026-11-05T05:51:10Z:\r\n\r\n    ticket        XE-0483  (event index 5383, public=True)\r\n    api status    accepted   -> assessment_held = True\r\n    GET /v1/tickets/XE-0483  ->  assessed_tier = None     (WITHHELD)\r\n    GET /v1/log?ref=XE-0483  ->  ticket.award.tier = 'minor'   (DISCLOSED)\r\n\r\n    ticket        XE-0462  (event index 5438, public=True)\r\n    api status    accepted   -> assessment_held = True\r\n    GET /v1/tickets/XE-0462  ->  assessed_tier = None     (WITHHELD)\r\n    GET /v1/log?ref=XE-0462  ->  ticket.award.tier = 'medium'  (DISCLOSED)\r\n\r\nXE-0462 shows the contradiction inside a single log stream. The full anonymous\r\n`GET /v1/log?ref=XE-0462` response, newest first:\r\n\r\n    idx=5439  proposal.adopted  {\"field\": \"award_xe\", \"reason\": \"\", \"ticket\": \"XE-0462\", \"proposal\": 404}\r\n    idx=5438  ticket.award      {\"tier\": \"medium\", \"ticket\": \"XE-0462\", \"approved\": false, \"award_xe\": 800000000}\r\n    idx=5437  proposal.adopted  {\"field\": \"status\", ...}\r\n    idx=5436  ticket.status     {\"to\": \"accepted\", \"from\": \"triaging\", \"via\": \"proposal:403\", ...}\r\n    idx=5434  proposal.adopted  {\"field\": \"effort_eng\", ...}\r\n    idx=5433  ticket.facts      {\"changes\": {}, \"held\": [\"effort_eng\"], \"via\": \"proposal:402\"}\r\n    idx=5432  proposal.adopted  {\"field\": \"mainnet_gate\", ...}\r\n    idx=5431  ticket.facts      {\"changes\": {}, \"held\": [\"mainnet_gate\"], \"via\": \"proposal:401\"}\r\n    idx=5430  proposal.adopted  {\"field\": \"assessed_tier\", ...}\r\n    idx=5429  ticket.facts      {\"changes\": {}, \"held\": [\"assessed_tier\"], \"via\": \"proposal:400\"}\r\n    idx=5428  proposal.adopted  {\"field\": \"verdict\", ...}\r\n    idx=5427  ticket.facts      {\"changes\": {}, \"held\": [\"verdict\"], \"via\": \"proposal:399\"}\r\n\r\nAt index 5429 the desk correctly reduces the `assessed_tier` change to\r\n`{\"changes\": {}, \"held\": [\"assessed_tier\"]}` — it names the field and withholds the\r\nvalue, exactly as `f323a99` intends. Nine indices later, at 5438, `ticket.award`\r\npublishes `\"tier\": \"medium\"` for the same ticket.\r\n\r\n## What I expected\r\n\r\n`GET /v1/log?ref=XE-0462` served to an anonymous reader should not contain the\r\n`assessed_tier` of a ticket in a held status. Either `ticket.award` should join\r\n`HELD_PAYLOAD_KEYS` with `{\"tier\"}`, or — better, since a denylist has to be remembered\r\nfor every new event kind — `public_payload()` should filter held fact *values* by\r\nvocabulary rather than by key name, or `set_award()` should emit the tier only when\r\n`not assessment_held(t)`.\r\n\r\n## Reproduce\r\n\r\nRead-only, unauthenticated, standard library only:\r\n\r\n    python3 poc_desk_public_log_leak.py --out poc_evidence.json\r\n\r\nOr by hand:\r\n\r\n    curl -s 'https://bounty.xe.network/v1/tickets/XE-0462' | jq '{status,claimed_tier,assessed_tier,verdict}'\r\n    curl -s 'https://bounty.xe.network/v1/log?ref=XE-0462&limit=100' \\\r\n      | jq '.events[] | select(.kind==\"ticket.award\") | {index,public,payload}'\r\n\r\nExpected output is in `poc_output.txt`; the machine-readable cross-check of all 12\r\n`ticket.award` events is in `poc_evidence.json`.\r\n\r\n## Impact\r\n\r\nThe hold exists because, in the words of the comment above `ASSESSMENT_HELD` in\r\n`desk/services/tickets.py:224-227`:\r\n\r\n    # While a bug is confirmed and unfixed, the team's assessment of it (tier, verdict, gate, effort, which\r\n    # internal ticket carries it) is a ranked list of what works against XE and when it will stop working.\r\n\r\n`ticket.award` leaks one field of that list — the confirmed severity — for any public\r\nticket that has reached the point where an award amount is set, which is precisely the\r\nwindow in which the bug is accepted, unfixed and awaiting a patch. An unauthenticated\r\nreader learns which confirmed-but-unfixed findings the team rates highest, before the\r\nfix ships and before the public page is meant to say so. The same commit gated\r\n`GET /v1/export/triage.md` behind `sees_assessment()` for exactly this reason; the log\r\npath was not covered.\r\n\r\nScope of the leak is bounded, and I want to be precise about that rather than overstate\r\nit:\r\n\r\n- Only `assessed_tier` leaks on this path. `verdict`, `mainnet_gate`, `effort_eng` and\r\n  `internal_ref` remain correctly withheld.\r\n- It only fires on public-visibility tickets. Events on private tickets are written\r\n  `public=False`, and Critical and Severe reports are private by default\r\n  (`desk/services/reporters.py:38`, `PRIVATE_TIERS = (\"critical\", \"severe\")`), so the\r\n  sealed reports are not exposed by this path.\r\n- `to_dict` already serves `award_xe` unconditionally (`tickets.py:777`), so the award\r\n  amount itself is public by design and is not part of this claim. Because the ceiling\r\n  table in `config/desk.yaml` maps tiers to amounts, a reader can already infer an\r\n  approximate band from `award_xe` alone; the incremental disclosure is the exact\r\n  confirmed tier rather than an inferred one.\r\n\r\nOn that basis I claim **Medium** and I think **Minor** is a defensible assessment. The\r\nreason I did not claim Minor is that this defeats a control the team shipped in the same\r\nrelease, on the same data, and the two paths visibly contradict each other within one\r\nticket's log — so the fix belongs with `f323a99` rather than being treated as cosmetic.\r\n\r\n## Suggested fix\r\n\r\nSmallest change, in `desk/log.py`:\r\n\r\n    HELD_PAYLOAD_KEYS = {\r\n        \"ticket.facts\": frozenset({\"reason\"}),\r\n        \"ticket.status\": frozenset({\"reason\"}),\r\n        \"proposal.created\": frozenset({\"value\"}),\r\n        \"ticket.award\": frozenset({\"tier\"}),\r\n    }\r\n\r\nThat mirrors the existing pattern but leaves the denylist keyed on event kind, so any\r\nfuture event that carries a held value under a new name repeats the bug. Two more\r\ndurable options:\r\n\r\n1. Filter by value vocabulary instead of key name — hold any payload value that\r\n   equals a `TIERS`/`VERDICTS`/`GATES`/`EFFORTS` member when the referenced ticket is\r\n   in `ASSESSMENT_HELD`. This needs the ticket lookup `public_payload()` does not\r\n   currently have, so it would move to the call sites.\r\n2. Stop emitting the held value at the source: in `set_award()`, include `tier` only\r\n   when `not assessment_held(t)`. The award event keeps its meaning (`award_xe`,\r\n   `approved`) and the tier is published later by the normal `patched`-onwards path.\r\n\r\nOption 2 is the smallest diff and cannot regress when a new event kind appears.\r\n\r\n## Prior-art check\r\n\r\nI checked this against every open and closed ticket on the desk and every issue on\r\n`xeprotocol/xe` before filing. The related desk findings are distinct in root cause,\r\ndata subject and reader:\r\n\r\n- XE-0322 — an agent token holding `read:private` reads *reporters'* payout addresses\r\n  and sign-in IPs from events written `public=False`. Root cause is the coarse\r\n  `read:private` gate on the log read routes. Here the events are written `public=True`\r\n  and the reader is anonymous with no credentials at all.\r\n- XE-0344 — `reply.sent` payloads carry the private reply *body*. Different event kind,\r\n  different data. That report notes \"every sibling path follows the invariant\" and\r\n  checks `note.added` and `ticket.created`; it does not examine `ticket.award`.\r\n- XE-0345 — the `public` flag, `ref` and signature presence sit outside the hash\r\n  envelope. A tamper-evidence issue, not a disclosure one.\r\n- XE-0212 — `GET /v1/tickets/{id}/log` over-serves to the *owning reporter* of a\r\n  private ticket. Different principal and different route gate.\r\n- XE-0519 — the award ceiling fails open when `assessed_tier` is unset. Concerns the\r\n  award amount computation, not its disclosure.\r\n- XE-0310 — the anonymous leaderboard leaks identity and award totals of still-private\r\n  tickets. Different endpoint (`leaderboard()`), different data.\r\n\r\nNothing on the desk or on `xeprotocol/xe` mentions `ticket.award`, `HELD_PAYLOAD_KEYS`,\r\nor the `f323a99` assessment hold.\r\n\r\n## Bounds\r\n\r\nRead-only. I did not create, modify, withdraw or reply to any ticket; did not sign in;\r\ndid not use or attempt to use any credential, cookie, token or invitation; did not write\r\nto the desk database; did not test the SSE stream beyond reading its source; and did not\r\nrun any load against the desk or the testnet. The attached script issues only\r\nunauthenticated `GET` requests to `bounty.xe.network` and writes one local file.\r\n\r\nThe two live examples are tickets whose bodies are already public, and the disclosed\r\nvalues are the desk's own severity labels for them, quoted here because they are the\r\nevidence. No sealed report content was accessed or is reproduced.","patch_refs":[{"id":400,"repo":"xeprotocol/desk","kind":"commit","ref":"fb93a8aa284bd145bcad9c30266d1aa5a721cdcf","title":"","url":"https://github.com/xeprotocol/desk/commit/fb93a8aa284bd145bcad9c30266d1aa5a721cdcf","note":"","state":"","author":"","added_by":"token:6","created_at":"2026-11-08T21:12:28.530390+00:00"}],"thread":[{"id":1107,"source":"desk","source_ref":"reply:657","author":"Joseph Denne","team":true,"body":"Thanks for the report. We have confirmed the gap you describe in the desk's public log and it is being handled together with a related fix. We will update you here: https://bounty.xe.network/XE-0604","created_at":"2026-11-08T20:17:41.885067+00:00"},{"id":1295,"source":"desk","source_ref":"reply:834","author":"Joseph Denne","team":true,"body":"Thanks for the report. The fix is on the desk now; this ticket moves to patched, and the assessment and any award follow the fix.","created_at":"2026-11-08T21:28:32.357147+00:00"}]}