<!-- XE-17986 · Sealing attachments into the blob store is a non-transactional filesystem mutation: a rollback leaves sealed ciphertext served publicly and the ticket unsealed · testnet -->
*Markdown view of <https://bounty.xe.network/XE-17986>. The page is the record; this is the same page for reading.*

XE-17986 · Bounty

# Sealing attachments into the blob store is a non-transactional filesystem mutation: a rollback leaves sealed ciphertext served publicly and the ticket unsealed

Closed · duplicate
—claimed Medium
web
filed 2026-11-18 03:17 UTC
by xe:a2b14c2a

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Medium

Area
:   Other

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-23 09:05 UTC

Told
:   2026-11-23 09:05 UTC

### Patches

None linked.

### History

- [807551](https://bounty.xe.network/log/807551) 2026-11-23 09:05 UTC proposal.adopted
- [807550](https://bounty.xe.network/log/807550) 2026-11-23 09:05 UTC reply.sent
- [807549](https://bounty.xe.network/log/807549) 2026-11-23 09:05 UTC ticket.status new → closed
- [805463](https://bounty.xe.network/log/805463) 2026-11-23 09:05 UTC proposal.adopted
- [805462](https://bounty.xe.network/log/805462) 2026-11-23 09:05 UTC ticket.facts area
- [805461](https://bounty.xe.network/log/805461) 2026-11-23 09:05 UTC proposal.adopted
- [805460](https://bounty.xe.network/log/805460) 2026-11-23 09:05 UTC ticket.facts
- [805459](https://bounty.xe.network/log/805459) 2026-11-23 09:05 UTC proposal.adopted
- [805458](https://bounty.xe.network/log/805458) 2026-11-23 09:05 UTC ticket.facts
- [803852](https://bounty.xe.network/log/803852) 2026-11-23 09:03 UTC note.added
- [803851](https://bounty.xe.network/log/803851) 2026-11-23 09:03 UTC proposal.created
- [803850](https://bounty.xe.network/log/803850) 2026-11-23 09:03 UTC proposal.created

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

### Report

Area: desk/services/tickets.py (seal\_thread / set\_facts)

Summary
When a ticket's visibility is switched to private, `set_facts` calls `seal_thread` while the request transaction is still uncommitted. `seal_thread` rewrites every attachment blob on disk (`path.write_bytes(vault.seal(...))`) and seals message/reply bodies in place. If anything fails after the first blob write but before the commit, the filesystem now holds ciphertext while the database rolls back to unsealed rows and a public ticket. The rows still say sealed\=False, the ticket stays public, and `open_attachment` serves the on-disk (now sealed) blob to public readers: public attachment downloads permanently return opaque ciphertext, while a partially-completed loop can leave some blobs sealed and others plaintext for the same ticket. There is no recovery path — re-sealing skips rows whose DB flag is false but whose bytes are already ciphertext, and nothing marks them for re-write.

Evidence

- desk/services/tickets.py:1203 `async def seal_thread(...)`
- desk/services/tickets.py:1218-1224 `path.write_bytes(ctx.vault.seal(path.read_bytes()))` executed inside the still-open transaction; `a.sealed = True` set on the ORM row only
- desk/services/tickets.py:958-967 `set_facts` visibility-\>private branch calls `seal_thread(ctx, db, t)` before commit
- desk/services/reporters.py:592-596 `open_attachment` streams whatever bytes are on disk with no seal-awareness
- Failure sources between first write and commit: `ctx.events.append` can raise (log signing failure), the `ticket.sealed` insert can fail, connection drop, or process death mid-loop (partial seal)

Attack path / impact
Not attacker-driven directly; a transient error or crash during a visibility change corrupts sealed evidence permanently. A ticket that should be private remains public with its attachments now unreadable garbage; a partially sealed ticket leaks the unsealed remainder while the sealed part is destroyed. Sealed evidence integrity is a core promise of the desk (bug triage records).

Preconditions
A visibility change to private on a ticket with attachments; any error/crash between the first blob write and commit.

Fix
Make the mutation transactional end-to-end: seal into new blob paths (write ciphertext to a temp location), commit DB rows, then swap/rewrite blobs after commit with a recovery sweeper that reconciles disk state to committed rows; or journal the seal operation so a crashed run can be resumed idempotently.

### Thread

**Joseph Denne**team2026-11-23 09:05 UTCdesk

Thanks. This is the same finding as an earlier report that is not public, 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, file a new report that links https://bounty.xe.network/XE-17986 and says what differs; it is read like any other.
