Skip to content

fix(plugins): require auth on slack/clickup/twitter transcript webhooks keyed only by uid - #14447

Open
hridaya423 wants to merge 3 commits into
BasedHardware:mainfrom
hridaya423:fix/transcript-webhook-auth
Open

hridaya423 wants to merge 3 commits into
BasedHardware:mainfrom
hridaya423:fix/transcript-webhook-auth

Conversation

@hridaya423

@hridaya423 hridaya423 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

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-app POST /webhook + /api/send_message, /api/search_messages, /api/search_channels: uid taken raw (query for the webhook, JSON body for the chat tools), then the victim's Slack token posts/searches as them.
  • omi-clickup-app POST /webhook: same shape; attacker segments create tasks in the victim's ClickUp list.
  • omi-twitter-app POST /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.py guard replicating the merged mentor pattern: Authorization: Bearer header or <app>_webhook_token query param checked with hmac.compare_digest against the <APP>_WEBHOOK_SECRET env var, wired as uid: str = Depends(require_<app>_webhook_auth) on the /webhook route. Fail-closed: 503 when unconfigured, 401 on missing/wrong token, 422 on blank uid.

Scope matches the mentor precedent: only the backend-invoked /webhook is gated. The settings-page routes share the fleet-wide uid model tracked by #13463. Existing test stubs gained a Depends attribute so the apps still load hermetically.

Tests

test_<app>_webhook_auth.py per 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 via require_slack_tool_auth (token check only; uid arrives in the JSON body).

Refs #14446

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
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @hridaya423 — careful, well-scoped fix. It replicates the merged mentor pattern (#13685, plugins/basic/mentor_webhook_auth.py) across the three remaining transcript webhooks, matching the precedent's structure exactly.

What I verified:

  • plugins/omi-slack-app/slack_webhook_auth.py — require_slack_webhook_auth composes the token check with uid binding (503 unconfigured / 401 missing-or-wrong / 422 blank uid), and the separate require_slack_tool_auth correctly authenticates-only for the /api/* chat tools whose uid lives in the JSON body. One shared secret for both is consistent.
  • plugins/omi-slack-app/main.py — /webhook swaps uid: str = Query(...) for uid: str = Depends(require_slack_webhook_auth); /api/send_message, /api/search_messages, /api/search_channels gain _auth: None = Depends(require_slack_tool_auth). No other routes change.
  • plugins/omi-clickup-app/clickup_webhook_auth.py + main.py (/webhook) and plugins/omi-twitter-app/twitter_webhook_auth.py + main_simple.py (/webhook) — identical guard, wired only into the webhook route. Fail-closed throughout: hmac.compare_digest, empty/whitespace secret → 503 rather than open.
  • Tests: test_slack_webhook_auth.py (including the tool-auth variant), test_clickup_webhook_auth.py, test_twitter_webhook_auth.py are hermetic stdlib unittests with real status-code assertions for every branch; the one-line Depends stub additions in the five existing test files keep the app modules importable hermetically.

Two items for the merge decision:

  1. Deployment coordination, same as the mentor rollout: the backend dispatcher (backend/utils/app_integrations.py) currently appends only ?uid=... to app webhook URLs and sends no auth header, and the ChatTools flow has no header documented either. Once this lands, these webhooks fail closed (503/401) until <APP>_WEBHOOK_SECRET is set and the dispatcher is taught to present the token; webhook health tracking will auto-disable failing apps after 72h. That's the accepted fail-closed tradeoff from fix(plugins): bind mentor transcript buffer to authenticated uid #13685 — flagging it so it's a deliberate choice here too.
  2. CI coverage: the three new test files aren't in .github/checks-manifest.yaml, so they won't run in CI after merge (the mentor PR did register its test). The existing plugins/omi-slack-app/** triggers do exercise the updated stubs. Suggest adding the three entries, either here or as a follow-up.

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 need human response.

@Git-on-my-level Git-on-my-level added security-review Touches auth, provider routing, secrets, or security-sensitive surfaces python labels Sep 18, 2026
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>
@hridaya423

Copy link
Copy Markdown
Contributor Author

Thanks — addressed (2): registered all three new test files in .github/checks-manifest.yaml (slack-webhook-auth-tests, clickup-webhook-auth-tests, twitter-webhook-auth-tests), following the mentor-session-auth precedent. Verified with the repo runner: run_checks.py --lane local --check-id <id> → PASS ×3. Commit f556c2f6d9.

On (1): agreed — same deliberate fail-closed rollout tradeoff as the merged mentor PR #13685; the dispatcher needs <APP>_WEBHOOK_SECRET configured before or alongside merge.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open on f556c2f6d961.

remaining-hole slack/clickup/twitter transcript webhook uid auth; 0-CI BLOCKED.

I am not approving or merging this SHA.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open. Not approving f556c2f6d961. slack/clickup/twitter webhook auth helpers are new files; not on origin/main. CONFLICTING DIRTY, 0 checks. Not shrink-only across three apps.

— Astar, on behalf of @aryanorastar

@Git-on-my-level

Copy link
Copy Markdown
Member

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:

  • plugins/omi-slack-app/slack_webhook_auth.py — require_slack_webhook_auth composes the token check with uid binding; require_slack_tool_auth correctly authenticates-only for /api/send_message, /api/search_messages, /api/search_channels, whose uid arrives in the JSON body.
  • plugins/omi-clickup-app/clickup_webhook_auth.py and plugins/omi-twitter-app/twitter_webhook_auth.py — same guard shape wired as uid: str = Depends(require__webhook_auth) on /webhook.
  • All guards fail closed: 503 when the *_WEBHOOK_SECRET env var is unconfigured, 401 on missing/wrong token via hmac.compare_digest, 422 on blank uid.
  • Hermetic tests per app (test_slack_webhook_auth.py, test_clickup_webhook_auth.py, test_twitter_webhook_auth.py) cover the boundary matrix; the Depends stub additions to test_channel_resolution.py, test_segments.py, test_slack_search.py, test_clickup_client.py, and test_settings_page.py keep the existing suites hermetic.

Two points for the maintainer signing off on merge:

  1. Deployment ordering: guards fail closed, so SLACK_WEBHOOK_SECRET / CLICKUP_WEBHOOK_SECRET / TWITTER_WEBHOOK_SECRET must be configured on the plugin dispatcher before (or atomically with) merge, or all transcript deliveries to these three apps will return 503. This is the same deliberate rollout tradeoff accepted for the mentor fix.
  2. Threat model note: each app uses one global shared secret (not per-user binding), so any holder of the secret can deliver for any uid. That matches the trusted-backend-caller model of the mentor/zapier precedents and is fine for internal dispatch — just flagging it as a conscious model choice rather than an oversight.

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 need human response.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python security-review Touches auth, provider routing, secrets, or security-sensitive surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants