<!-- XE-0993 · GET /team/triage.md and triage.pending_duplicates_of bypass read:private checks, and ticket.html/my.html expose unannounced award_xe · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0993>. The page is the record; this is the same page for reading.*

XE-0993 · Bounty

# GET /team/triage.md and triage.pending\_duplicates\_of bypass read:private checks, and ticket.html/my.html expose unannounced award\_xe

Triaging
claimed Medium
web
filed 2026-11-07 04:06 UTC
by Ashev Ardiansyah

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Medium

Area
:   Other

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-08 20:46 UTC

Told
:   2026-11-08 20:46 UTC

### Patches

None linked.

### History

- [45434](https://bounty.xe.network/log/45434) 2026-11-08 20:46 UTC reply.sent
- [45433](https://bounty.xe.network/log/45433) 2026-11-08 20:46 UTC proposal.adopted
- [45432](https://bounty.xe.network/log/45432) 2026-11-08 20:46 UTC proposal.adopted
- [45431](https://bounty.xe.network/log/45431) 2026-11-08 20:46 UTC ticket.status new → triaging
- [45430](https://bounty.xe.network/log/45430) 2026-11-08 20:46 UTC proposal.adopted
- [45429](https://bounty.xe.network/log/45429) 2026-11-08 20:46 UTC ticket.award
- [45428](https://bounty.xe.network/log/45428) 2026-11-08 20:46 UTC proposal.adopted
- [45427](https://bounty.xe.network/log/45427) 2026-11-08 20:46 UTC ticket.facts
- [45426](https://bounty.xe.network/log/45426) 2026-11-08 20:46 UTC proposal.adopted
- [45425](https://bounty.xe.network/log/45425) 2026-11-08 20:46 UTC ticket.facts
- [45424](https://bounty.xe.network/log/45424) 2026-11-08 20:46 UTC proposal.adopted
- [45423](https://bounty.xe.network/log/45423) 2026-11-08 20:46 UTC ticket.facts

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

### Report

Three closely related authorization and disclosure gaps exist in the triage and ticket rendering paths added/updated in commits `56735d7` and `d4198e7`:

### 1\. `GET /team/triage.md` allows `read:public` agent tokens and leaks private ticket metadata (`desk/api/mirror.py:165-171`, `desk/services/triage.py:199-243`)

While the HTML route `GET /team/triage` (`desk/ui.py:490`) enforces `_team(who)` (human team session only), its Markdown mirror `GET /team/triage.md` (`desk/api/mirror.py:165-171`) only checks `can(who.principal, "read:notes")`:

```
@router.get("/team/triage.md", response_class=PlainTextResponse)
async def team_triage_md(ctx: Ctx, db: Db, who: Who, area: str | None = None, ...):
    if not can(who.principal, "read:notes"):
        raise HTTPException(403, "team and triage agents only")
```

Under `desk/authz.py:66-70`, any agent token with `"read:public"` scope satisfies `can(p, "read:notes")` when `ticket=None`. `team_triage_md` then calls `triage.build_queue(ctx, db, ...)` (`desk/services/triage.py:199-243`), which queries `Ticket` rows directly without filtering on `Ticket.visibility == "public"` when `not can(p, "read:private")` and formats reporter labels/emails via `rsvc.label(reporters[t.reporter_id])` plus pending proposal summaries. Thus an agent token scoped only to `read:public` (explicitly denied `read:private`) can fetch `/team/triage.md` and read every private ticket's ID, title, area, status, reporter email/handle, and pending proposal details.

Similarly, `triage.pending_duplicates_of(db, tid)` (`desk/services/triage.py:246-267`, called from `desk/ui.py:201` on `/tickets/{tid}`) queries `Proposal` joined to `Ticket` without filtering `Ticket.visibility` by the caller's principal, so a `read:public` token viewing a public canonical ticket sees the IDs and titles of `private` tickets that have pending duplicate proposals pointing to it.

### 2\. `ticket.html` and `my.html` render `t.award_xe` and approval state before status is `awarded`/`paid` (`desk/templates/ticket.html:52`, `desk/templates/my.html:27`)

In `desk/services/tickets.py:299-301`, the JSON API hides `award_xe` from non-team readers until `t.status in ("awarded", "paid")`:

```
"award_xe": (t.award_xe // 1_000_000 if t.award_xe is not None else None)
if (see_held or t.status in ("awarded", "paid"))
else None,
```

However, the Jinja templates `desk/templates/ticket.html:52-58` and `desk/templates/my.html:27` bind directly to the ORM model `t.award_xe` and `t.award_approved_at`:

```
{% if t.award_xe is not none %}
<dt>Award</dt>
<dd class="num">{{ (t.award_xe // 1000000) }} XE
  {% if t.award_approved_at %}<span class="muted">(approved)</span>{% else %}<span class="muted">(awaiting Reviewer approval)</span>{% endif %}
</dd>
{% endif %}
```

As soon as an award amount is staged or proposed on a ticket still in `triaging`, `accepted`, `fixing`, or `patched`, anonymous visitors on `/tickets/{id}` and reporters on `/my` see the held `award_xe` amount and whether a Reviewer has approved it.

### Remediation

1. In `desk/api/mirror.py:167`, require `can(who.principal, "read:private")` (or pass `who.principal` into `triage.build_queue` and `triage.pending_duplicates_of` and filter out `Ticket.visibility == "private"` when `not can(p, "read:private")`).
2. Gate the `t.award_xe` block in `ticket.html` and `my.html` on `is_team or t.status in ('awarded', 'paid')`.

### Thread

**Joseph Denne**team2026-11-08 20:46 UTCdesk

Thanks for the report. We checked the desk source: the triage-export route and helper names in the first part are not in the code, and the export is already restricted to the team and its agents. The second part — the award field being visible on a ticket before it is awarded — is being looked at. We will update this ticket when there is more to say.
