Details
If the victim is not currently logged in when they click the URL:
HTTP Request:
GET /api/chat-links/ws_abc123/tok_xxxxxxxxxxxxxxxx/handoff HTTP/1.1
Host: budibase.company.com
HTTP Response:
HTTP/1.1 302 Found
Location: /builder/auth/login
Set-Cookie: budibase:returnurl=%2Fapi%2Fchat-links%2Fws_abc123%2Ftok_xxxxxxxxxxxxxxxx%2Fhandoff; Path=/
After the victim logs in, the browser follows the return URL and the attack completes identically to Step 3.
---
---
Remediation
Minimum Fix — Add Consent Page
Convert the handoff to a two-step flow:
GET /api/chat-links/:instance/:token/handoff
→ Show consent page: "You are linking your Budibase account to
[externalUserName]'s Slack identity ([provider]).
This allows them to interact with AI agents as you. [Confirm] [Cancel]"
POST /api/chat-links/:instance/:token/handoff (with CSRF token)
→ Perform the upsertChatIdentityLink() write
Moving the write to POST removes it from publicRoutes, making Budibase's existing CSRF middleware apply automatically.
---
Credits,
Vishal Kumar B
https://github.com/VishaaLlKumaaRr
References
packages/server/src/api/routes/chat.ts:22— public route registrationpackages/server/src/api/controllers/ai/chatIdentityLinks.ts:61–110— full vulnerable controllerpackages/server/src/sdk/workspace/ai/chatIdentityLinks.ts:135–165— session creation (embeds attacker's externalUserId)packages/server/src/sdk/workspace/ai/chatIdentityLinks.ts:202–247— upsertChatIdentityLink (permanent write)packages/server/src/api/controllers/webhook/chatHandler.ts:421— identity resolution during agent message handlingpackages/server/src/ai/tools/budibase/automations.ts— automation trigger capabilitypackages/server/src/ai/tools/budibase/rows.ts— row read/write capabilitypackages/types/src/sdk/chatIdentityLinks.ts— session + link type definitions- CWE-352: Cross-Site Request Forgery
- CWE-284: Improper Access Control