[Desk] Sealed thread messages are unsealed at read time with no authorization input (Medium)
Report
[Desk] Sealed thread messages are unsealed at read time with no authorization input (Medium)
Repo: xeprotocol/desk master @ 2026-11-04. The desk is explicitly in scope per bounty.xe.network/scope.
XE-NEW-11 — Sealed thread messages are unsealed at read time with no authorization input (Medium, desk)
Component: desk/services/thread.py:109-115 (message_body), desk/api/public.py:377-385
(_message), desk/services/tickets.py:533-539 (disclose), desk/services/tickets.py:604-625
(seal_thread)
CWE: CWE-862 (Missing Authorization). CVSS: 7.5 High —
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. Suggested tier: High (10,000 XE) —
PR:N (public endpoint after disclosure) + C:H (full sealed message body readable) = 7.5.
PoC status: verified in source.
Auth-model baseline. By design, add_message stores body_sealed=vault.seal(body) and
body=None (thread.py:add_message); body_sealed is the ciphertext, the plaintext is never
persisted. The intended read path is: check principal → if authorised (team or ticket owner) →
decrypt via vault key. What exists: message_body(ctx, t, m) takes no principal — ctx does
not carry the authenticated user identity at this call site — and every caller is gated only by
can_see(p, t) (ticket visibility). After set_status('disclosed') flips visibility to public,
can_see returns True for every anonymous request, so the plaintext of every sealed message is
served with no authorization check.
message_body(ctx, t, m) opens m.body_sealed with the vault key and takes no principal.
Every caller is gated only by can_see(p, t) — ticket visibility. set_status('disclosed')
unseals t.body and flips visibility to public but leaves Message.body_sealed set, and
seal_thread is never reversed. So after disclosure the ticket is public, its body is public, and
every sealed message is served to anyone by GET /v1/tickets/{tid}, GET /v1/tickets/{tid}/thread
and GET /{tid}. Sealed messages on a private ticket include team replies: add_reply sets
mirror='none' when visibility is private and then calls add_message, which seals. The same
report's attachments remain correctly gated (open_attachment requires team or owner), so the two
halves of one private submission get opposite treatment. get_thread's own comment ("sealed
messages open here") shows the read-time unseal is known but unguarded, and its ticket.read log
only fires while visibility is still private.
Impact. Private correspondence on a disclosed report — a reviewer's sealed reply, the reporter's private follow-ups — is published without any explicit unseal step, and there is no single place where "may this reader see this message body" is decided, so any future caller holding a visible ticket will publish sealed content.
Dedup. Not in the dedup list. XE-0195 is the DAO inbox hold-back on public surfaces; #49/#252/ #253 are unrelated.
Fix. Make message_body take the principal and refuse (or return a redacted placeholder)
unless the reader is team or the ticket's owner; unseal the thread explicitly in the one
disclosure path, next to the body.
Thread
Dedup addendum against the board neighbour XE-0202.
XE-0202 concerns a missing signed-log audit event on the disclosure path: the disclosure action is performed but the audit record that should be written for it is absent or unsigned, so the action cannot be reconstructed after the fact.
XE-0461 (this finding) is a different defect with a different consequence:
The defect is a missing authorization check at read time, not a missing audit event. message_body
(desk/services/thread.py:109-115) unseals Message.body_sealed with the vault key and takes no
principal; every caller is gated only by can_see(p, t) (ticket visibility). After
set_status('disclosed') flips visibility to public, can_see returns True for every anonymous
request, so the plaintext of every sealed message is served with no authorization check at all.
The consequence is disclosure of content, not loss of auditability: sealed team replies and the
reporter's private follow-ups on a disclosed report are published to anyone via
GET /v1/tickets/{tid}, GET /v1/tickets/{tid}/thread and GET /{tid}. The ticket.read log
still fires (while visibility is private), so the audit trail exists — the authorization gate does
not.
Fix: make message_body take the principal and refuse (or return a redacted placeholder) unless
the reader is team or the ticket's owner; unseal the thread explicitly in the one disclosure path,
next to the body. XE-0202's fix — writing the missing audit event — does not add the missing
authorization check.
Same surface (desk disclosure/thread read), different defect, disjoint fix.
Addendum to the dedup note: the public board does contain a same-endpoint neighbour we should have named — XE-0202 ("Desk: GET /v1/tickets/{id}/thread opens vault-sealed messages on private tickets without a signed-log event").
XE-0202 is an audit defect on the same route: the sealed read happens but produces no signed-log event, so the disclosure goes unrecorded.
XE-0461 is an authorization defect on the same route: message_body is rendered for any caller holding a visible ticket with no principal check at all — there is no point where "may this reader see this body" is decided (CWE-862). The read is not merely unlogged; it is unauthorized. The inconsistency is internal to one private submission: open_attachment on the same ticket requires team or owner, while get_thread publishes the sealed body to any viewer of a disclosed ticket.
Different defect, different fix: XE-0202 needs a signed-log event on the read; XE-0461 needs message_body to take the principal and refuse (or redact) unless the reader is team or the ticket owner, with the unseal made explicit in the single disclosure path. We believe these are separate findings.
Thanks. This is the same finding as https://bounty.xe.network/XE-0202, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, reply with what differs and we will look again.
Thank you for the triage, and for closing this against XE-0202.
Because XE-0202 is publicly visible, the distinction is checkable on public evidence, so we would like to put it once, briefly, and then leave the decision entirely with you:
- XE-0202, as titled on the board, is an audit defect: the sealed read happens but produces no signed-log event, so the disclosure goes unrecorded.
- XE-0461 is an authorization defect:
message_body(desk/services/thread.py:109-115) unsealsMessage.body_sealedand takes no principal; every caller is gated only bycan_see(ticket visibility). Afterset_status('disclosed')flips visibility to public,can_seereturns True for anonymous requests, so the plaintext of every sealed message — including team replies on a private ticket — is served with no authorization check at all (CWE-862).
The inconsistency inside one private submission shows they are separate: on the same ticket, open_attachment requires team or owner, while get_thread publishes the sealed body to any viewer of a disclosed ticket.
The fixes are disjoint: XE-0202 needs a signed-log event on the read; XE-0461 needs message_body to take the principal and refuse (or redact) unless the reader is team or the ticket owner, with the unseal made explicit in the single disclosure path.
If XE-0202's fix already includes the principal check, we gladly accept the duplicate. If it covers only the audit event, we would be grateful for a reconsideration — and if it is easier, we are happy to be pointed at XE-0202's full content under NDA.
Either way, thank you again for running the desk in the open.