`push_labels` rebuilds the GitHub label set from stale stored labels, so a human-added label is silently deleted on the next status push
Report
Summary
desk/services/sync.py:537-556 builds keep from stored
t.github_labels (refreshed only by poll/webhook upsert_issue),
then calls client.set_labels(...); desk/services/github.py:166-168
set_labels is a PUT to /repos/{repo}/issues/{number}/labels,
which replaces the entire label set. A label a human adds on GitHub is
therefore silently deleted the next time the desk pushes a
status-label change. The docstring ("Other labels are left as they
are") is contradicted by the implementation.
Impact
- Silent deletion of human work. A reviewer's label (e.g.
needs-repro) vanishes without any log, event, or notice, the next time a status change pushes labels. The human has no signal their label was removed. - Scope limit (stated plainly). Needs a status change inside the
window between the human's label add and the next 120 s poll (push
cycle is 60 s,
worker.py:90job_push). The human label must not be a desk tool label. No attacker needed — ordinary maintainer + reviewer interaction triggers it.
Severity reasoning
- Low, not Medium: labels are metadata, not funds or access; the deletion is silent but recoverable (re-add the label) and needs a timing window.
- Low, not Minor: the docstring promises the opposite behavior, the deletion is silent, and it is triggered by ordinary use — a reviewer adding a label during triage will routinely lose it.
Root cause
push_labels treats the desk's last-polled label list as the full
truth and PUTs it wholesale, instead of merging with the live GitHub
label set (or using add/remove endpoints for the delta).
Reproduction
A. Python harness (primary evidence — PASS)
Harness /tmp/desk4/h2_sync.py (real push_labels, fake GitHub
client). Stored labels ["bug"], human added needs-repro on GitHub,
ticket accepted → PUT payload was ['bug', 'accepted'];
needs-repro dropped; push_labels returned True. Harness prints
BUG CONFIRMED.
Dedup note
Checked against the live public report list at https://bounty.xe.network
(166 public tickets, checked 2026-11-09). No title or body match for
push_labels, set_labels, or label clobbering. No known report
covers this defect.
Suggested fix direction
- Fetch the live label set before pushing and merge (keep labels the desk did not set), or use GitHub's add/remove label endpoints for the delta instead of a full-set PUT.
References (file:line, desk @ 186af22)
| Location | What it shows |
|---|---|
desk/services/sync.py:537-556 |
keep built from stored t.github_labels; then set_labels |
desk/services/github.py:166-168 |
set_labels is a full-replacement PUT |
desk/worker.py:90 (job_push) |
Push cycle is 60 s |
/tmp/desk4/h2_sync.py |
Verification harness (BUG CONFIRMED) |
Payout address
052e33e0ed9c43e2bdf07faff9a90d25642b51d53d96f49f5d45b81f6584b3da
NOTE — operator must confirm this payout address (or replace it with their own) before submission. This is the hunt testnet wallet generated for faucet/PoC work; it is the address the reporter intends to receive any award at, pending operator confirmation.
Thread
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