Repository navigation
fix(channels): deny unauthorized Discord and Telegram binding access - #118704
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 11:24 AM ET / 15:24 UTC. ClawSweeper reviewWhat this changesThe PR prevents unauthorized Discord and Telegram interactive callbacks from receiving privileged conversation-binding helpers while continuing to invoke registered plugin callbacks and preserving authorized binding behavior. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain Keep this PR open: it repairs a real authorization boundary that current Priority: P1 Review scores
Verification
How this fits togetherDiscord and Telegram receive interactive callbacks, determine sender authorization, and dispatch registered plugin handlers. The shared binding helper can read, create, refresh, or detach persistent conversation bindings when it receives plugin ownership metadata, so each channel transport must withhold that authority from untrusted callbacks. flowchart LR
A[Discord or Telegram callback] --> B[Channel ingress]
B --> C[Sender authorization]
C --> D[Registered plugin handler]
C -->|authorized| E[Binding helper with owner authority]
C -->|unauthorized| F[Fail-closed binding helper]
E --> G[Persistent conversation binding]
F --> D
D --> H[Channel response]
Decision needed
Why: The implementation is a narrow security repair, but current evidence does not show the changed Telegram authorization behavior in a real transport setup, and the protected maintainer label requires an explicit human merge decision. Before merge
Agent review detailsSecurityNone. PR surfaceSource +14, Tests +155. Total +169 across 4 files. View PR surface stats
Review metrics
Mantis proof suggestionA Telegram live proof lane can directly show that an unauthorized callback retains normal handler dispatch while privileged binding operations fail closed. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the channel-owner gate after a redacted live Telegram callback probe demonstrates both outcomes: an unauthorized user cannot read, bind, refresh, or detach state, while the ordinary registered handler still executes; then refresh the merge result against current Do we have a high-confidence way to reproduce the issue? Yes, from source: current main gives every matched Discord and Telegram callback a helper backed by pluginRoot, and the shared owner auto-refreshes existing bindings or auto-approves them under persistent approval. The proposed regression cases should execute that real dispatcher-to-helper path and assert denied helper results plus zero adapter reads and writes for unauthorized callbacks. Is this the best way to solve the issue? Yes: the transport owners already own the authorization fact, and withholding only pluginRoot reuses the shared helper's established fail-closed behavior without changing callback dispatch or the public plugin SDK. The merged Slack repair uses the same owner-boundary pattern. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7fabb5564831. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* origin/main: (78 commits) fix(parallels): recover Windows poll transport failures (#118479) fix(channels): deny unauthorized Discord and Telegram binding access (#118704) fix(test): bound shared git inventory lookup (#111171) fix(onboard): keep referenced provider secrets out of plaintext (#118702) docs: show canonical agent roster configuration (#118722) fix(channels): generate catalog from package manifests (#118097) fix(zalouser): distinguish probe timeout from auth failure (#111336) improve(ui): cut E2E shard runtime by reusing the bundle (#118697) fix(cli): publish completion caches atomically (#118715) fix(whatsapp): honor disabled self-chat without widening group access (#118711) fix(voice-call): terminate carrier calls after realtime startup failures (#118699) fix(slack): isolate GovSlack media trust and delivery (#118695) fix(browser): wrap page-controlled action results (#118691) fix(security): sanitize JSON-escaped forged content boundaries (#118698) test(qa): prove real yielded-child completion and channel delivery (#118707) fix(doctor): honor explicit plugin-only migration authority (#118700) fix(security): detect child_process calls through aliases and computed members (#116304) test(gateway): avoid async facade mock race (#118708) fix(gateway): preserve final speech during transcription shutdown (#118693) fix(gateway): resume durable outbound delivery retries (#118694) ...
…penclaw#118704) * fix(channels): deny unauthorized Discord and Telegram binding access * test(discord): remove retired access-group config key
* origin/main: fix(parallels): recover Windows poll transport failures (openclaw#118479) fix(channels): deny unauthorized Discord and Telegram binding access (openclaw#118704) fix(test): bound shared git inventory lookup (openclaw#111171)
Summary
Root cause and transport ownership
Both transports deliberately dispatch registered plugin callbacks even when
isAuthorizedSender=false; existing channel integrations rely on this behavior. However, both transport owners also passed the privileged plugin registration root to the shipped generic conversation-binding helper. An unapproved Discord guild member or Telegram group user could therefore request an automatically approved binding, inspect it, and detach it despite being unauthorized.Each existing transport owner now withholds only privileged binding authority unless its own authenticated sender, account, and conversation identity are present. The public callback, response behavior, shared external plugin SDK helper, channel routing, and Telegram topic identity remain unchanged. This exactly matches the already-landed Slack owner repair in #118662.
Actual registered-handler proof
Before repair, real registered Discord and Telegram handlers reached the actual shared binding owner and produced
{"authorized":false,"handlerInvoked":true,"requestStatus":"bound","readReturnedBinding":true,"detachRemoved":true}.After repair, both unauthorized transports still invoke their ordinary plugin handler but return request error/read null/detach false with zero privileged adapter reads or writes. Authorized Discord guild and Telegram forum/DM controls continue to bind/read/detach with their real canonical identities.
git diff --check: clean.Maintainer proof decision and exact-head coverage disclosure
The immediately preceding commit
4d359710d677953d2f9cafe679abadfb730567edexecuted five actual registered Discord/Telegram interaction regressions: four authorized/unauthorized conversation-binding owner paths and one separate Telegram direct-message authorization case. Reviewed headd97e86833207c15cef3c2cd8f88f732c293edcf5is its direct child and changes only the Discord test fixture (+1/-4) to remove a retired configuration key. The Telegram production-dispatch Git blob remains exactly00b8162c517e8cfa397307c074511a31dc3c9e83; its test blob remains exactly297c6e61efa2c5b5382ee2a350e674aecb62e4e4. The Discord production-dispatch blob also remains unchanged, and both Discord authorization-owner cases passed again on the reviewed head.Exact-head hosted CI and Telegram help/tools/context/status smoke are green. Important coverage caveat: the compact hosted Node planner excludes extension projects, so those CI jobs do not execute Telegram callback/binding owner regressions. Attempts to rerun the Telegram suite in the isolated linked worktree failed during setup/collection before any case executed (121 pending; two suite setup/cleanup errors); no live Telegram channel was contacted. The installed-worktree alias points to a missing linked-worktree dependency; its attempted in-memory resolver adjustment did not make collection succeed. This is not represented as an exact-head Telegram pass.
Explicit maintainer decision: accept the actual parent-commit Telegram owner proof because the reviewed child contains byte-identical Telegram production and test objects, combined with exact-head Discord owner proof, green general Telegram smoke, full hosted guards/types/security checks, and the candid isolated-environment/live-channel limitations above.