<!-- XE-1128 · desk/services/sync.py: Post-Merge PR Title/Body Edits by Untrusted Contributors Force Unfixed Tickets to patched, Bypassing ASSESSMENT_HELD to Leak Held Assessments · testnet -->
*Markdown view of <https://bounty.xe.network/XE-1128>. The page is the record; this is the same page for reading.*

XE-1128 · Bounty

# desk/services/sync.py: Post-Merge PR Title/Body Edits by Untrusted Contributors Force Unfixed Tickets to patched, Bypassing ASSESSMENT\_HELD to Leak Held Assessments

Triaging
claimed High
web
filed 2026-11-07 16:31 UTC
by Ashev Ardiansyah

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   High

Area
:   Other

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-08 20:08 UTC

Told
:   2026-11-08 20:08 UTC

### Patches

None linked.

### History

- [39215](https://bounty.xe.network/log/39215) 2026-11-08 20:08 UTC proposal.adopted
- [39214](https://bounty.xe.network/log/39214) 2026-11-08 20:08 UTC reply.sent
- [39213](https://bounty.xe.network/log/39213) 2026-11-08 20:08 UTC proposal.adopted
- [39212](https://bounty.xe.network/log/39212) 2026-11-08 20:08 UTC ticket.facts area
- [39211](https://bounty.xe.network/log/39211) 2026-11-08 20:08 UTC proposal.adopted
- [39210](https://bounty.xe.network/log/39210) 2026-11-08 20:08 UTC ticket.facts
- [39209](https://bounty.xe.network/log/39209) 2026-11-08 20:08 UTC proposal.adopted
- [39208](https://bounty.xe.network/log/39208) 2026-11-08 20:08 UTC ticket.facts
- [39207](https://bounty.xe.network/log/39207) 2026-11-08 20:08 UTC proposal.adopted
- [39206](https://bounty.xe.network/log/39206) 2026-11-08 20:08 UTC ticket.facts
- [39205](https://bounty.xe.network/log/39205) 2026-11-08 20:08 UTC proposal.adopted
- [39204](https://bounty.xe.network/log/39204) 2026-11-08 20:08 UTC ticket.facts

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

### Report

In `desk/desk/services/sync.py`, `link_pull()` (`lines 178-216`) and `_follow_pull_state()` (`lines 224-251`) allow any merged GitHub Pull Request whose `title` or `body` matches `gh.closing_refs()` (`Fixes #N`, `Closes #N`, `Resolves #N`) to transition the referenced Desk ticket all the way to `status = "patched"`, regardless of `trusted = pull_is_maintainers(ctx, pull)`, based on line `232`:

```
if state == "merged":
    target, reason = "patched", f"{ref} merged"  # a merge is a maintainer's act whoever wrote the PR
```

However, on GitHub, **any external contributor (`author_association == "CONTRIBUTOR"`, `trusted == False`) whose PR has ever been merged into a tracked repository retains permanent permission to edit the `title` and `body` of their own PR after it has been merged**.

1. **Post-merge PR edit triggers unauthenticated state transition to `patched` (`desk/desk/services/sync.py:184-215, 231-244, 287-291, 450-452`):**
   When an untrusted contributor edits the title or body of an already-merged PR (e.g., an old docs/typo PR) to append `Fixes #1 Fixes #2 ...`, GitHub sends a `pull_request` (`action: "edited"`) webhook to `handle_webhook()` (`sync.py:450-452`), which calls `link_pull()` without checking `action` or whether the closing reference existed at merge time; `import_repo()` (`sync.py:287-291`) also re-processes the PR on the next poll because `pull["updated_at"]` advances. Because `pull["merged_at"]` is non-null, `state == "merged"`, and `_follow_pull_state()` ignores `trusted=False` and calls `tsvc.set_status_via_path(ctx, db, SYSTEM, t, "patched", ...)`, walking every referenced ticket in `PRE_PATCH = ("new", "triaging", "needs-info", "accepted", "fixing")` to `"patched"`.
2. **Complete bypass of `ASSESSMENT_HELD` confidentiality embargo and permanent draft lock (`desk/desk/services/tickets.py:230-238, 661-664, 931-941`):**
   While a confirmed bounty report is in `ASSESSMENT_HELD = ("new", "triaging", "needs-info", "accepted", "fixing")`, `tickets.to_dict()` withholds `assessed_tier`, `verdict`, `internal_ref`, and `internal_url` from public callers until `patched`. Forcing unfixed tickets in `accepted` or `fixing` to `patched` immediately sets `assessment_held(t) == False`, exposing the confidential `assessed_tier`, `verdict`, `internal_ref`, and `internal_url` of every unpatched vulnerability in that repository on `GET /v1/tickets` and `GET /v1/tickets/{ticket_id}`. Simultaneously, stepping `new`/`triaging`/`needs-info` tickets through `accepted` permanently sets `t.body_editable = False` (`tickets.py:663`), locking reporters out of editing their own drafts.

### Remediation

If `not trusted and state == "merged"`, do not allow newly added closing references discovered after `merged_at` (such as on `pull_request` `edited` events) to transition tickets to `"patched"`; only honor closing `PatchRef` links that were present at merge time or verified via GitHub's closing-issues event metadata.

### Thread

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

Thanks for the report. We have read it and can follow the behaviour you describe in the desk's GitHub sync; it is being handled and we will update this ticket when there is more to say.
