Repository navigation
fix(plugins): require auth on slack/clickup/twitter transcript webhooks keyed only by uid - #14447
hridaya423 wants to merge 3 commits into
Conversation
The real-time transcript webhook in each app bound `uid` straight from the query string, then acted on that uid's stored OAuth credentials — anyone who knows a uid can push transcript segments that post to the victim's Slack channel, create ClickUp tasks, or tweet from the victim's account. Same defect class as zapier (BasedHardware#14428) and the paid mentor fix; these three were missed by both and by BasedHardware#13463. Each app gets a <app>_webhook_auth.py guard (mentor pattern): Authorization bearer or <app>_webhook_token query param checked against <APP>_WEBHOOK_SECRET, wired as Depends() on /webhook. Fails closed 503 when unconfigured, 401 on bad token, 422 on blank uid. Existing test stubs gain a Depends attribute so the apps still load hermetically. Verified: 79 tests + 28 subtests pass across the three apps, including 18 new guard tests (503/401/422/accept paths per app). Refs BasedHardware#14446
|
Thanks @hridaya423 — careful, well-scoped fix. It replicates the merged mentor pattern (#13685, What I verified:
Two items for the merge decision:
The shared-secret scope (authenticates the caller, not the user) matches the mentor precedent and the fleet-wide model tracked by #13463, and the description acknowledges it. Leaving for human maintainer review: security-sensitive auth change on external-facing routes needs maintainer sign-off, and the rollout coordination in (1) is a deployment decision. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Reviewer noted the three new hermetic test files were not in .github/checks-manifest.yaml, so they would not run in CI after merge. Registers all three following the mentor-session-auth precedent, verified with run_checks.py --check-id (each PASS locally). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Thanks — addressed (2): registered all three new test files in On (1): agreed — same deliberate fail-closed rollout tradeoff as the merged mentor PR #13685; the dispatcher needs |
|
Keeping this open on remaining-hole slack/clickup/twitter transcript webhook uid auth; 0-CI BLOCKED. I am not approving or merging this SHA. |
|
Keeping this open. Not approving — Astar, on behalf of @aryanorastar |
|
Technical assessment on f556c2f (follow-up to the earlier automated review of this head). Independently verified against main: all three POST /webhook routes (plugins/omi-slack-app/main.py, plugins/omi-clickup-app/main.py, plugins/omi-twitter-app/main_simple.py) currently trust the caller-supplied uid query param with no authentication, while the handler acts with the victim's connected Slack/ClickUp/Twitter credentials — so the unauthenticated-write path this PR closes is real, and no equivalent fix has landed on main. The fix replicates the merged mentor pattern (plugins/basic/mentor_webhook_auth.py, #13685) faithfully:
Two points for the maintainer signing off on merge:
CI has not run on this PR (0 checks reported); the three new manifest checks (slack/clickup/twitter-webhook-auth-tests) need a green run before merge. Leaving for human maintainer review — auth-sensitive fix across three apps needs maintainer sign-off, and per the thread a maintainer is already tracking this head. Thanks @hridaya423 — solid, well-precedented security fix. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Summary
Three apps expose the same unauthenticated-uid webhook defect as zapier (#14428) and mentor (#13685, paid precedent), missed by both and by the #13463 umbrella:
omi-slack-appPOST /webhook+/api/send_message,/api/search_messages,/api/search_channels:uidtaken raw (query for the webhook, JSON body for the chat tools), then the victim's Slack token posts/searches as them.omi-clickup-appPOST /webhook: same shape; attacker segments create tasks in the victim's ClickUp list.omi-twitter-appPOST /webhook: same shape; attacker segments trigger posts from the victim's Twitter account.Anyone who knows a uid can push arbitrary transcript content that the victim's connected account acts on, an unauthenticated write/spam path into third-party workspaces.
Fix
Each app gets a
<app>_webhook_auth.pyguard replicating the merged mentor pattern:Authorization: Bearerheader or<app>_webhook_tokenquery param checked withhmac.compare_digestagainst the<APP>_WEBHOOK_SECRETenv var, wired asuid: str = Depends(require_<app>_webhook_auth)on the/webhookroute. Fail-closed: 503 when unconfigured, 401 on missing/wrong token, 422 on blank uid.Scope matches the mentor precedent: only the backend-invoked
/webhookis gated. The settings-page routes share the fleet-wide uid model tracked by #13463. Existing test stubs gained aDependsattribute so the apps still load hermetically.Tests
test_<app>_webhook_auth.pyper app (hermetic, stdlib): unconfigured secret → 503, missing token → 401, wrong token → 401, bearer and query token accepted, blank uid → 422.pytest plugins/omi-slack-app plugins/omi-clickup-app plugins/omi-twitter-app→ 81 tests + 28 subtests pass (20 new). Slack's three backend-called/api/*chat tools are gated by the same secret viarequire_slack_tool_auth(token check only; uid arrives in the JSON body).Refs #14446