Repository navigation
fix(plugins): require auth on zapier data-plane routes keyed only by uid - #14429
hridaya423 wants to merge 1 commit into
Conversation
/zapier/trigger/memory/sample returned the caller-chosen uid's latest conversation including the full transcript; /zapier/action/memories wrote an arbitrary conversation into any uid's account; the trigger subscribe/unsubscribe pair stored an attacker-controlled target_url against any uid; /zapier/memories accepted webhooks with no caller binding; /zapier/me answered status probes. All six trusted the client-supplied uid with no credential. Add require_zapier_webhook_auth (same fail-closed pattern as the merged mentor session fix, BasedHardware#13685): Authorization bearer or zapier_webhook_token query param checked against ZAPIER_WEBHOOK_SECRET with hmac.compare_digest; 503 when unconfigured, 401 on missing or mismatched token. Residual, tracked in BasedHardware#14428: the browser control-plane endpoints (/setup-zapier, /zapier/connect, /zapier/disconnect, /setup/zapier) remain uid-keyed because the Omi app opens them without a credential; with the data plane closed, toggling enabled state grants no data access. Binding them needs a capability token issued by the Omi backend link (the direction of BasedHardware#13463). Deployment note: ZAPIER_WEBHOOK_SECRET must be set and the Zapier app / Omi webhook callers configured to send it, matching the mentor precedent. Verification: python3 test_webhook_auth.py (10 tests incl. boundary cases) and python3 test_zapier_hardening.py (18 tests) all pass. Failure-Class: new — client-supplied uid accepted as authorization on unauthenticated plugin routes
|
Thanks @hridaya423 — this closes a real hole (#14428): six zapier data-plane routes were keyed only by a client-supplied
One thing needs maintainer coordination before deploy (not a code change): the shipped Zapier app ( Leaving formal sign-off to a human maintainer: this is an auth-boundary change on user transcript data, and the rollout sequencing above is a deployment decision. Code-wise this is in good shape. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Good catch on the rollout sequencing — you're right that |
|
Companion PR for the client side: #14471 — adds an optional |
|
Verified on Leaving this open as the remaining-hole vehicle on Not approving from here: hosted checks are not green (0-check / UNSTABLE / FTC). kodjima APPROVE is not a merge. I am not merging. |
|
Keeping this open. Not approving — Astar, on behalf of @aryanorastar |
…nts (#14471) * fix(zapier/omi-zap): send bearer token alongside uid for gated endpoints Companion to the server-side uid-as-auth fix (#14429): once ZAPIER_WEBHOOK_SECRET is set, /zapier/* data-plane routes require a shared-secret bearer token, and the published Zapier app would 401 on every call. Adds an optional "Integration Token" auth field whose value is sent as Authorization: Bearer on the auth test and, via requestTemplate, on every trigger/create request. Left optional so existing installs keep working until the secret rollout lands. Refs #14429 * fix(zapier/omi-zap): soften token helpText until token display lands
Fixes #14428
Summary
Six routes in
plugins/zapier/conversation_created.pytrusted the client-supplieduidwith no credential:GET /zapier/trigger/memory/samplePOST /zapier/action/memoriesPOST/DELETE /zapier/trigger/subscribetarget_urlunder the uidPOST /zapier/memoriesGET /zapier/meSame contract violation as the merged mentor session fix (#13665), wider blast radius.
Fix
plugins/zapier/webhook_auth.pyaddsrequire_zapier_webhook_auth, mirroringplugins/basic/mentor_webhook_auth.py:ZAPIER_WEBHOOK_SECRETenv secret,Authorization: Bearerorzapier_webhook_tokenquery param,hmac.compare_digest, fail-closed 503 when unconfigured, 401 on missing/mismatched token. Wired viaDependsonto all six routes.Residual + deployment note
/setup-zapier,/zapier/connect,/zapier/disconnect,/setup/zapier) stays uid-keyed; the Omi app opens those pages without a credential. With the data plane closed, toggling enabled state grants no data access. Binding them needs a backend-issued capability token (the security: P0 uid-as-auth + ADMIN_KEY default-off #13463 direction), tracked on [Bounty] security: zapier routes trust client-supplied uid — unauthenticated transcript read, account write, and exfiltration subscription #14428.ZAPIER_WEBHOOK_SECRETand configure the Zapier app / Omi webhook callers to send it, same shape as the mentor fix.Tests
python3 plugins/zapier/test_webhook_auth.py: 10 tests, fail-closed unconfigured (503 incl. blank secret), missing/wrong/non-bearer token (401), bearer + query token accepted, uid trimmed; plus a labeled static wiring check that all six routes declare the dependency.python3 plugins/zapier/test_zapier_hardening.py: 18/18 pass (stub extended withDepends/Query; existing positional-uid calls unchanged).Failure-Class: new — client-supplied uid accepted as authorization on unauthenticated plugin routes