{"id":"XE-1795","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":451,"title":"`push_labels` rebuilds the GitHub label set from stale stored labels, so a human-added label is silently deleted on the next status push","area":"other","claimed_tier":"minor","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-09T04:33:08.299119+00:00","updated_at":"2026-11-14T22:57:04.296924+00:00","source_created_at":null,"told_at":"2026-11-10T14:00:35.194150+00:00","status_changed_at":"2026-11-10T14:00:33.518678+00:00","url":"https://bounty.xe.network/XE-1795","body":"## Summary\r\n\r\n`desk/services/sync.py:537-556` builds `keep` from stored\r\n`t.github_labels` (refreshed only by poll/webhook `upsert_issue`),\r\nthen calls `client.set_labels(...)`; `desk/services/github.py:166-168`\r\n`set_labels` is a PUT to `/repos/{repo}/issues/{number}/labels`,\r\nwhich replaces the entire label set. A label a human adds on GitHub is\r\ntherefore silently deleted the next time the desk pushes a\r\nstatus-label change. The docstring (\"Other labels are left as they\r\nare\") is contradicted by the implementation.\r\n\r\n## Impact\r\n\r\n- **Silent deletion of human work.** A reviewer's label (e.g.\r\n  `needs-repro`) vanishes without any log, event, or notice, the next\r\n  time a status change pushes labels. The human has no signal their\r\n  label was removed.\r\n- **Scope limit (stated plainly).** Needs a status change inside the\r\n  window between the human's label add and the next 120 s poll (push\r\n  cycle is 60 s, `worker.py:90` `job_push`). The human label must not\r\n  be a desk tool label. No attacker needed — ordinary maintainer +\r\n  reviewer interaction triggers it.\r\n\r\n## Severity reasoning\r\n\r\n- **Low, not Medium:** labels are metadata, not funds or access; the\r\n  deletion is silent but recoverable (re-add the label) and needs a\r\n  timing window.\r\n- **Low, not Minor:** the docstring promises the opposite behavior, the\r\n  deletion is silent, and it is triggered by ordinary use — a\r\n  reviewer adding a label during triage will routinely lose it.\r\n\r\n## Root cause\r\n\r\n`push_labels` treats the desk's last-polled label list as the full\r\ntruth and PUTs it wholesale, instead of merging with the live GitHub\r\nlabel set (or using add/remove endpoints for the delta).\r\n\r\n## Reproduction\r\n\r\n### A. Python harness (primary evidence — PASS)\r\n\r\nHarness `/tmp/desk4/h2_sync.py` (real `push_labels`, fake GitHub\r\nclient). Stored labels `[\"bug\"]`, human added `needs-repro` on GitHub,\r\nticket accepted → PUT payload was `['bug', 'accepted']`;\r\n`needs-repro` dropped; `push_labels` returned True. Harness prints\r\n`BUG CONFIRMED`.\r\n\r\n## Dedup note\r\n\r\nChecked against the live public report list at https://bounty.xe.network\r\n(166 public tickets, checked 2026-11-09). No title or body match for\r\n`push_labels`, `set_labels`, or label clobbering. No known report\r\ncovers this defect.\r\n\r\n## Suggested fix direction\r\n\r\n- Fetch the live label set before pushing and merge (keep labels the\r\n  desk did not set), or use GitHub's add/remove label endpoints for\r\n  the delta instead of a full-set PUT.\r\n\r\n## References (file:line, desk @ 186af22)\r\n\r\n| Location | What it shows |\r\n|---|---|\r\n| `desk/services/sync.py:537-556` | `keep` built from stored `t.github_labels`; then `set_labels` |\r\n| `desk/services/github.py:166-168` | `set_labels` is a full-replacement PUT |\r\n| `desk/worker.py:90` (`job_push`) | Push cycle is 60 s |\r\n| `/tmp/desk4/h2_sync.py` | Verification harness (`BUG CONFIRMED`) |\r\n\r\n## Payout address\r\n\r\n```\r\n052e33e0ed9c43e2bdf07faff9a90d25642b51d53d96f49f5d45b81f6584b3da\r\n```\r\n\r\n**NOTE — operator must confirm this payout address (or replace it with\r\ntheir own) before submission.** This is the hunt testnet wallet generated\r\nfor faucet/PoC work; it is the address the reporter intends to receive\r\nany award at, pending operator confirmation.","patch_refs":[],"thread":[{"id":2139,"source":"desk","source_ref":"reply:1506","author":"Joseph Denne","team":true,"body":"Thank you for this report. We have read it against the code and it is being handled. The assessment and any award follow the fix. https://bounty.xe.network/XE-1795","created_at":"2026-11-10T14:00:19.792775+00:00"}]}