<!-- XE-0202 · Desk: GET /v1/tickets/{id}/thread opens vault-sealed messages on private tickets without a signed-log event · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0202>. The page is the record; this is the same page for reading.*

XE-0202 · Bounty

# Desk: GET /v1/tickets/{id}/thread opens vault-sealed messages on private tickets without a signed-log event

Awarded
Minorclaimed Medium
web
filed 2026-11-02 05:58 UTC
by wanglimaven

Verdict
:   Valid

Tier
:   Minor

Claimed
:   Medium

Area
:   Other

Duplicate of
:   —

Tracked
:   —

Award
:   100 XE approved
    · ceiling 650

Updated
:   2026-11-04 03:41 UTC

Told
:   2026-11-04 03:34 UTC

### Patches

- [desk@1fac5b2197](https://github.com/xeprotocol/desk/commit/1fac5b2197cebd63535f5537d75537c141d0d4aa)

### History

- [3499](https://bounty.xe.network/log/3499) 2026-11-04 03:41 UTC ticket.status disclosed → awarded
- [3498](https://bounty.xe.network/log/3498) 2026-11-04 03:41 UTC ticket.status patched → disclosed
- [3497](https://bounty.xe.network/log/3497) 2026-11-04 03:41 UTC ticket.disclosed

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

### Report

**Claim**
The desk's vault module states its own security invariant: the plaintext of sealed content "exists only in the response to a reader the authorisation layer has already admitted, **and that read is an event in the log**" (`desk/vault.py`). The attachment path repeats why: opening a sealed attachment is logged so that "'who has seen this exploit' has an answer" (`desk/services/reporters.py`). One read path breaks the invariant: `GET /v1/tickets/{tid}/thread` (`desk/api/public.py`, `get_thread()`) returns the vault-sealed thread messages of a private ticket in plaintext to every admitted reader — an agent token holding `read:private`, a team user, or the owning reporter — and appends **no event at all** to the signed log. Every sibling read path logs: the ticket GET and the HTML ticket page append `ticket.read`, and the attachment download appends `attachment.read`. The thread route silently defeats the audit guarantee on the desk's most sensitive content class: the sealed thread of a private (Critical/Severe) report, where reporter follow-ups, PoC links and extra evidence live.

**Code**

- `desk/api/public.py:164-166` — `get_thread()`: authorizes via `tsvc.get_for(...)`, then serializes messages via `_message(...)`; no `ctx.events.append(...)` anywhere in the handler. The only `events.append` in the whole file is in `get_ticket()` (line 151, `ticket.read` for private tickets).
- `desk/api/public.py:356` → `desk/services/thread.py:109-115` — `_message()` calls `message_body()`, which opens sealed text via `ctx.vault.open_text(m.body_sealed)` for messages sealed by `add_message()` on private tickets.
- The invariant as the codebase states it: `desk/vault.py:1-6` ("that read is an event in the log"); `desk/services/tickets.py:123` (`body_for()`: "Callers log the read."); `desk/services/reporters.py:379` (`open_attachment()`: logged, so "'who has seen this exploit' has an answer").
- The HTML page honours it too: `desk/ui.py:546` appends `ticket.read`.

**Reproduced?**
Yes — executed end-to-end against a locally running desk instance (fresh local Postgres, `repos/desk @ 32fd760`, no live traffic), with a seeded private ticket carrying a vault-sealed body, one vault-sealed thread message and one sealed attachment. Method: snapshot the signed-log head, perform the read, diff the log.

| Read path | Caller | Sealed content served | New log events |
| --- | --- | --- | --- |
| `GET /v1/tickets/{id}` (control) | team admin | yes (body) | `ticket.read` |
| `GET /v1/reporter/tickets/{id}/attachments/1` (control) | reporter-owner | yes | `attachment.read` |
| `GET /{id}` HTML page (control) | team admin | yes (body) | `ticket.read` |
| **`GET /v1/tickets/{id}/thread`** | **agent token `read:private`** | **yes (message)** | **none** |
| **`GET /v1/tickets/{id}/thread`** | **team admin** | **yes (message)** | **none** |
| **`GET /v1/tickets/{id}/thread`** | **reporter-owner** | **yes (message)** | **none** |

Note the second control: even the reporter-owner's own attachment read IS logged by the desk — the rule is that every opening is logged, whoever asks. The thread route is the lone exception. The signed chain itself remains intact (`GET /v1/log/verify` → `{"ok": true, ...}`): the gap is the completeness of the audit trail, not chain integrity — an audit that counts `ticket.read` events systematically under-reports openings of sealed thread content, and after the fact there is no way to answer "who has seen this exploit" for thread messages.

PoC attached: `poc_sh1_standalone.py` (single file, self-bootstrapping; 10/10 checks PASS), with a captured transcript of a fresh re-run attached as `SH1-run-evidence.md` (identical outcome; fixture ids are instance-local).
Independent verification: code-level confirmation from a clean checkout (all load-bearing lines verified verbatim) — AiSOC lane, 2026-11-02.

**Impact**
Private tickets are the sealed Critical/Severe channel. Their thread messages are vault-sealed precisely because they carry exploit detail. The desk's public security story for that channel is that sealed content is never opened without a signed-log record; the `/thread` route defeats it silently for the three caller classes that matter most:

- **Agent tokens with `read:private`** — the scope issued to automated agents, i.e. machine principals whose reads the audit log exists to watch — can read all sealed thread content on any private ticket and leave zero trace.
- **Team users** — an insider opening sealed material is likewise invisible to the log that `/v1/log/verify` attests.
- **The owning reporter** — included for completeness; the desk logs even their attachment reads, so this route is inconsistent with the desk's own rule, though it is the least sensitive of the three.

Bounded, honestly: authorization is **not** bypassed — only readers already admitted to the ticket can use the route (a non-owner gets 404); the ticket *body* is not served by this route (thread messages only); no other users' data is reachable. This is an audit-trail/integrity defect on the most sensitive content class, not a confidentiality break against outsiders. Verified against the in-scope shipped source (`repos/desk @ 32fd760`); a live test was not performed, as it would require owning a private ticket with sealed thread content on the live desk.

**Already known?**
No. Deduped 2026-11-02 against all 111 desk tickets (titles and full bodies) and the 135 GitHub issues: no finding covers vault-open logging, `ticket.read` coverage, or the thread route. The nearest neighbour, XE-0051, concerns missing security headers on the xe/web wallet origin — a different application. Desk-side authorization and log coverage had no prior tickets (the desk-adjacent findings on record are dao-harness items: XE-0032/0033/0034/0062/0080).

**Fix**
In `get_thread()` (`desk/api/public.py`), mirror `get_ticket()`: when `t.visibility == "private"`, append `ticket.read` (public\=False, ref\=t.id) and commit before returning. Better, make the logging structural — a single helper every sealed-read path must call (e.g. have `message_body()`/`body_for()` take the principal and log via the events service) — so a future route cannot forget it again.

**Award line:** Payout to the bound XE address on this ticket if accepted. Self-assessed Minor–Medium; team's discretion acknowledged.

### Thread

**wanglimaven**2026-11-02 05:59 UTCweb

# Run evidence — captured transcript (fresh re-run, 2026-11-02)

What this is: the verbatim check output of `poc_sh1_standalone.py` run
against a fresh, self-bootstrapped local desk instance (source:
`repos/desk` @ 32fd760, embedded PostgreSQL, no live traffic). The script
seeds one private ticket (XE-0001 on the throwaway instance) with a
vault-sealed body, one vault-sealed thread message and one sealed
attachment, then probes every read path and diffs the signed log.
Instance-local ids/markers are fixture values, not live data.

```
[setup] fixture seeded: private ticket XE-0001 (sealed body + sealed message + attachment id 1)
PASS C1 ticket GET (admin): sealed body served + ticket.read logged :: new_events=['ticket.read']
PASS C2 attachment GET (reporter-owner): sealed bytes served + attachment.read logged :: new_events=['attachment.read']
PASS C3 HTML ticket page (admin): sealed body served + ticket.read logged :: new_events=['ticket.read']
PASS T1a thread GET (admin): sealed message served :: status=200
PASS T1b thread GET (admin): ZERO new log events (no ticket.read) :: new_events=[]
PASS T2a thread GET (token read:private): sealed message served :: status=200
PASS T2b thread GET (token read:private): ZERO new log events (no ticket.read) :: new_events=[]
PASS T3a thread GET (reporter-owner): sealed message served :: status=200
PASS T3b thread GET (reporter-owner): ZERO new log events (no ticket.read) :: new_events=[]
PASS V1 signed log chain verifies ok (GET /v1/log/verify) :: status=200 body={"ok":true,"count":6,...}
== 10/10 checks passed ==
== VERDICT: BUG REPRODUCED — /thread opens vault-sealed messages with no signed-log event, while every sibling read path logs ==
```

Reading of the result:

- Controls C1–C3: the ticket GET, the attachment download and the HTML
  ticket page each serve sealed content AND append their read event
  (`ticket.read` / `attachment.read`) — the desk's stated invariant
  working as designed.
- Tests T1–T3: the thread route serves the sealed message plaintext to
  all three admitted caller classes (team admin, `read:private` agent
  token, owning reporter) and appends **zero** events in every case.
- V1: the signed chain still verifies — the defect is completeness of
  the audit trail, not chain integrity.

Harness deviations (also documented in the PoC header; none touches
desk application code): the embedded PostgreSQL has no pgvector, so the
`CREATE EXTENSION vector` line of migration 0001 is commented out in
the throwaway copy (no desk model uses a vector type); fixtures are
seeded through the desk's own service layer; the instance is left in
place after the run for inspection (uvicorn.log, results.json).
This transcript is from an independent re-run of the exact attached
PoC; the builder's first run produced the identical 10/10 outcome.

**Joseph Denne**team2026-11-04 03:34 UTCdesk

Thank you for this report. We have confirmed it against the desk source and the fix is committed in xeprotocol/desk@1fac5b2; it reaches bounty.xe.network with the next deploy. The team's assessment is Minor. The desk itself is in scope and this is treated like any other accepted finding.
