{"id":"XE-1128","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":242,"title":"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","area":"other","claimed_tier":"high","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-07T16:31:15.159629+00:00","updated_at":"2026-11-08T20:08:36.509211+00:00","source_created_at":null,"told_at":"2026-11-08T20:08:36.695569+00:00","status_changed_at":"2026-11-08T20:08:36.530810+00:00","url":"https://bounty.xe.network/XE-1128","body":"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`:\n```python\nif state == \"merged\":\n    target, reason = \"patched\", f\"{ref} merged\"  # a merge is a maintainer's act whoever wrote the PR\n```\nHowever, 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**.\n\n1. **Post-merge PR edit triggers unauthenticated state transition to `patched` (`desk/desk/services/sync.py:184-215, 231-244, 287-291, 450-452`):**\nWhen 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\"`.\n\n2. **Complete bypass of `ASSESSMENT_HELD` confidentiality embargo and permanent draft lock (`desk/desk/services/tickets.py:230-238, 661-664, 931-941`):**\nWhile 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.\n\n### Remediation\nIf `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.","patch_refs":[],"thread":[{"id":898,"source":"desk","source_ref":"reply:428","author":"Joseph Denne","team":true,"body":"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.","created_at":"2026-11-08T20:08:36.509211+00:00"}]}