[Bounty $150] security: composio Notion OAuth callback binds workspace grants to any uid from raw state
Summary
plugins/composio/src/notion.py treats the OAuth state parameter as the uid with no verification:
GET /api/notion/auth?uid=<uid>sends the raw uid asstate(only percent-encoded): https://github.com/BasedHardware/omi/blob/main/plugins/composio/src/notion.py#L65notion_callbackdoesstore_notion_credentials(state, ...)andbackground_tasks.add_task(extract_all_pages, access_token, state): https://github.com/BasedHardware/omi/blob/main/plugins/composio/src/notion.py#L242
Impact
OAuth login CSRF / grant rebinding. An attacker completes Notion OAuth for their own workspace, then calls the callback with a victim's uid as state; the attacker's workspace grant is stored under the victim's uid and every page of the attacker's workspace is imported as the victim's memories. The sibling apps that got this right (#14444: linear/notion oauth, plus dropbox, google-calendar, whoop, clickup/slack/github) either sign the state or store a random server-side state and compare; this app never did and was missed by #14445/#14551.
Fix
PR #14689: HMAC-SHA256-signed state (uid:<sig>, keyed by NOTION_CLIENT_SECRET) at initiation, verified in the callback before the token exchange; forged/unsigned state gets a 400 and never reaches the exchange. Hermetic regression tests (7, no third-party deps) + .github/checks-manifest.yaml registration included.
Proposed bounty: $150 — single app, mirrors the accepted linear/notion fix in #14444/#14445.
cc @kodjima33 @Git-on-my-level
Closing as completed — resolved via merged PR #14689 and claimed via Zendesk Ticket #134554575.