fix(slack): approval and confirm buttons ignore configured authorization - #38069
Conversation
|
Acknowledged. I checked the competing Slack interactive-callback auth PRs (#29627, #33280, #33844, and #36670) and this branch is another implementation of the same issue. There is no additional code change to push from this comment alone; maintainers should choose the canonical fix, and I am fine with this PR being superseded if one of the earlier branches is preferred. |
d325a06 to
ab964a5
Compare
Slack Block Kit approval and slash-confirm callbacks previously checked only Slack-specific allowlist state before resolving protected approval decisions. That bypassed gateway-level allowlists and paired-user authorization when callbacks arrived outside normal message dispatch. Bind gateway pairing state into platform adapters and gate Slack callback resolution through Slack/global allowlists, pairing, and allow-all fallback semantics before mutating messages or resolving approvals.
ab964a5 to
121ef40
Compare
|
This PR has been superseded by the fix that landed on The same Slack interactive-callback authorization gap is now fixed by #41226 ( Relevant attribution:
I checked current I am fine with this PR being closed as superseded by #41226. |
|
Closing as superseded by #41226, which landed the same Slack interactive-callback authorization fix on main. |
Summary
An unauthorized Slack user who can see a pending approval or slash-confirm message in a shared channel or thread can approve, deny, or persist another caller's dangerous-command decision when the operator relies on
GATEWAY_ALLOWED_USERSor pairing instead ofSLACK_ALLOWED_USERS.That changes protected approval state and can unblock execution or destructive slash-command handling across the Slack external surface.
SLACK_ALLOWED_USERS; when unset, there is no caller authorization check.Route Slack interactive callbacks through the same authorization helper used for normal Slack messages, or require the callback user to satisfy an equivalent combined allowlist/pairing decision before resolving approvals.
Linked context
Closes #38068
Real behavior proof (required for external PRs)
Affected component (issue scope)
File:
gateway/platforms/slack.py:2812-2822,2920-2932Secondary paths:
gateway/platforms/slack.py:2740-2799posts slash-confirm buttons;gateway/platforms/slack.py:2666-2719posts approval buttons;gateway/run.py:7073-7154defines the broader gateway authorization set.Files changed in this PR
gateway/run.pygateway/platforms/slack.pytests/gateway/test_slack_approval_buttons.pyBehavior reproduced or verified
maincommite2ea648a08265164ef103005d533ed28ec58ceb8, configure Slack withGATEWAY_ALLOWED_USERS=U_AUTHORIZEDand leaveSLACK_ALLOWED_USERSunset.U_AUTHORIZEDandU_ATTACKERin the same Slack channel.U_AUTHORIZEDtrigger a dangerous command or destructive slash confirmation so Slack posts the callback buttons.U_ATTACKERand observe that the callback reachesresolve_gateway_approval(...)orslash_confirm.resolve(...).Expected fixed behavior
Route Slack interactive callbacks through the same authorization helper used for normal Slack messages, or require the callback user to satisfy an equivalent combined allowlist/pairing decision before resolving approvals.
Tests and validation
bash scripts/run_tests.sh tests/gateway/test_slack_approval_buttons.pyEnvironment
Verified against latest upstream
mainvia source receipt (source_ready,upstream-main,e2ea648a08265164ef103005d533ed28ec58ceb8). Full-public submit-fix route is declared by candidate metadata. Redaction checked: no secrets, tokens, credentials, private logs, or unrelated local paths are included.Risk checklist